hydromt.data_catalog.DataCatalog.get_geodataset#

DataCatalog.get_geodataset(data_like: Path | str | DataArray | Dataset, bbox: List | None = None, geom: GeoDataFrame | None = None, buffer: float | int = 0, variables: List | None = None, time_tuple: Tuple | None = None, single_var_as_array: bool = True, **kwargs) Dataset[source]#

Returns a clipped, sliced and unified GeoDataset.

To clip the data to the area of interest, provide a bbox or geom, with optional additional buffer and align arguments. To slice the data to the time period of interest, provide the time_tuple argument. To return only the dataset variables of interest provide the variables argument.

NOTE: Unless single_var_as_array is set to False a single-variable data source will be returned as xarray.DataArray rather than Dataset.

Parameters:
  • data_like (str, Path, xr.Dataset, xr.DataArray) – Data catalog key, path to geodataset file or geodataset xarray object. If a path to a 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.

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

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

  • time_tuple (tuple of str, datetime, optional) – Start and end date of period of interest. By default the entire time period of the dataset is returned.

  • single_var_as_array (bool, optional) – If True, return a DataArray if the dataset consists of a single variable. If False, always return a Dataset. By default True.

Returns:

obj – GeoDataset

Return type:

xarray.Dataset or xarray.DataArray