hydromt.data_catalog.DataCatalog.get_geodataframe#

DataCatalog.get_geodataframe(data_like: str | Path | GeoDataFrame, bbox: List | None = None, geom: GeoDataFrame | None = None, buffer: float | int = 0, variables: List | str | None = None, predicate: str = 'intersects', **kwargs)[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 and align arguments. To return only the dataframe columns of interest provide the variables argument.

Parameters:
  • data_like (str, Path, gpd.GeoDataFrame) – Data catalog key, path to vector file or a vector geopandas object. If a path to a vector file is provided it will be added to the data_catalog with its based on the file basename without extension.

  • bbox (array-like of floats) – (xmin, ymin, xmax, ymax) bounding box of area of interest (in WGS84 coordinates).

  • geom (geopandas.GeoDataFrame/Series,) – A geometry defining the area of interest.

  • buffer (float, optional) – Buffer around the bbox or geom area of interest in meters. By default 0.

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

  • align (float, optional) – Resolution to align the bounding box, by default None

  • variables (str or list of str, optional.) – Names of GeoDataFrame columns to return. By default all columns are returned.

  • **kwargs – Additional keyword arguments that are passed to the GeoDataFrameAdapter function. Only used if data_like is a path to a vector file.

Returns:

gdf – GeoDataFrame

Return type:

geopandas.GeoDataFrame