hydromt.model.processes.region.parse_region_basin#
- hydromt.model.processes.region.parse_region_basin(region: dict, *, data_catalog: DataCatalog, hydrography_path: str | Path, basin_index_path: str | Path | None = None) GeoDataFrame [source]#
Parse a basin /subbasin / interbasin region and return the GeoDataFrame.
- Parameters:
region (
dict
) –Dictionary describing region of interest. Entire basin can be defined based on an ID, one or multiple point location (x, y), or a region of interest (bounding box or geometry) for which the basin IDs are looked up. The basins withint the area of interest can be further filtered to only include basins with their outlet within the area of interest (‘outlets’: true) of stream threshold arguments (e.g.: ‘uparea’: 1000).
Common use-cases include: * {‘basin’: ID} * {‘basin’: [ID1, ID2, ..]} * {‘basin’: [x, y]} * {‘basin’: [[x1, x2, ..], [y1, y2, ..]]} * {‘basin’: /path/to/point_geometry} * {‘basin’: [xmin, ymin, xmax, ymax]} * {‘basin’: [xmin, ymin, xmax, ymax], ‘outlets’: true} * {‘basin’: [xmin, ymin, xmax, ymax], ‘<variable>’: threshold}
Subbasins are defined by its outlet locations and include all area upstream from these points. The outlet locations can be passed as xy coordinate pairs, but also derived from the most downstream cell(s) within a area of interest defined by a bounding box or geometry, optionally refined by stream threshold arguments.
The method can be speed up by providing an additional
bounds
argument which should contain all upstream cell. If cells upstream of the subbasin are not within the provide bounds a warning will be raised. Common use-cases include:{‘subbasin’: [x, y], ‘<variable>’: threshold}
{ 'subbasin': [[x1, x2, ..], [y1, y2, ..]], '<variable>': threshold, 'bounds': [xmin, ymin, xmax, ymax] }
{‘subbasin’: /path/to/point_geometry, ‘<variable>’: threshold}
{‘subbasin’: [xmin, ymin, xmax, ymax], ‘<variable>’: threshold}
{‘subbasin’: /path/to/polygon_geometry, ‘<variable>’: threshold}
Interbasins are similar to subbasins but are bounded by a bounding box or geometry and do not include all upstream area. Common use-cases include:
{‘interbasin’: [xmin, ymin, xmax, ymax], ‘<variable>’: threshold}
{‘interbasin’: [xmin, ymin, xmax, ymax], ‘xy’: [x, y]}
{‘interbasin’: /path/to/polygon_geometry, ‘outlets’: true}
data_catalog (
DataCatalog
) – DataCatalog object containing the data sources.hydrography_fn (
strPath
) – Path of the hydrography raster dataset in the data catalog.basin_index_path (
StrPath
, optional) – Path of the basin index raster dataset in the data catalog.