pyflwdir.regions.region_area#
- pyflwdir.regions.region_area(regions: ndarray, transform: Affine = Affine(1.0, 0.0, 0.0, 0.0, -1.0, 0.0), latlon: bool = False) tuple[ndarray, ndarray][source]#
Return the area [m2] for each unique label in regions.
- Parameters:
regions (2D array of int) – Raster of positive region IDs.
transform (Affine, optional) – Affine transform from pixel coordinates to the coordinate reference system.
latlon (bool) – True for geographic CRS, False for projected CRS. If True, transform units are interpreted as degrees and areas are converted to square metres, by default False.
- Returns:
lbs, areas – array of the unique region IDs, and associated areas [m2]
- Return type:
1D array