pyflwdir.regions.region_area#

pyflwdir.regions.region_area(regions, transform=Affine(1.0, 0.0, 0.0, 0.0, -1.0, 0.0), latlon=False)[source]#

Returns the area [m2] for each unique label in regions.

Parameters:
  • regions (2D array of int) – raster with unique IDs for each region, must have the same shape as data.

  • latlon (bool) – True for geographic CRS, False for projected CRS. If True, the transform units are assumed to be degrees and converted to metric distances.

  • transform (Affine) – Coefficients mapping pixel coordinates to coordinate reference system.

Returns:

lbs, areas – array of the unique region IDs, and associated areas [m2]

Return type:

1D array