hydromt.data_catalog.DataCatalog.get_geodataframe#

DataCatalog.get_geodataframe(data_like: str | SourceSpecDict | Path | Dataset | DataArray | GeoDataFrameSource, bbox: List | None = None, geom: GeoDataFrame | None = None, buffer: float | int = 0, handle_nodata: NoDataStrategy = NoDataStrategy.RAISE, variables: List | str | None = None, predicate: str = 'intersects', provider: str | None = None, version: str | None = None, **kwargs) GeoDataFrame | None[source]#

Return a clipped and unified GeoDataFrame (vector).

To clip the data to the area of interest, provide a bbox or geom, with optional additional buffer argument. To return only the GeoDataFrame columns of interest provide the variables argument.

Parameters:
  • data_like (Union[ str, SourceSpecDict, Path, xr.Dataset, xr.DataArray, GeoDataFrameSource ]) – Data catalog key, path to vector file, a GeoDataFrameSource object, or a vector geopandas object. The catalog key can be a string or a dictionary with the following keys: {‘name’, ‘provider’, ‘version’}. If a path to a vector file is provided it will be added to the catalog with its based on the file basename.

  • bbox (Optional[List], optional) – (xmin, ymin, xmax, ymax) bounding box of area of interest (in WGS84 coordinates), by default None

  • geom (Optional[gpd.GeoDataFrame], optional) – A geometry defining the area of interest, by default None

  • buffer (Union[float, int], optional) – Buffer around the bbox or geom area of interest in meters, by default 0

  • handle_nodata (NoDataStrategy, optional) – How to react when no data is found, by default NoDataStrategy.RAISE

  • variables (Optional[List], optional) – Names of GeoDataFrame variables to return, or all if None, by default None

  • predicate (str, optional) – If predicate is provided, the GeoDataSet is filtered by testing the predicate function against each item. Requires bbox or mask. options are: {‘intersects’, ‘within’, ‘contains’, ‘overlaps’, ‘crosses’, ‘touches’}, by default ‘intersects’

  • provider (Optional[str], optional) – Specifies a data provider, by default None

  • version (Optional[str], optional) – Specifies a data version, by default None

  • **kwargs – Extra keyword arguments passed to the GeoDataFrameSource construction

Returns:

a clipped, sliced and unified GeoDataFrame

Return type:

gpd.GeoDataFrame

Raises:
  • ValueError – If data_like is of an unknown type

  • NoDataException – If no data is found and handle_nodata is NoDataStrategy.RAISE