hydromt.data_catalog.DataCatalog.get_geodataset#
- DataCatalog.get_geodataset(path_or_key: Union[Path, str], bbox: Optional[List] = None, geom: Optional[GeoDataFrame] = None, buffer: Union[float, int] = 0, variables: Optional[List] = None, time_tuple: Optional[Tuple] = None, single_var_as_array: bool = True, **kwargs) Dataset [source]#
Returns a clipped, sliced and unified GeoDataset from the data catalog.
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 and check their presence, 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:
path_or_key (str) – Data catalog key. 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: