hydromt.data_catalog.DataCatalog.get_source_bbox#

DataCatalog.get_source_bbox(source: str, provider: str | None = None, version: str | None = None, detect: bool = True, strict: bool = False) Tuple[Tuple[float, float, float, float], int] | None[source]#

Retrieve the bounding box and crs of the source.

Parameters:
  • source (str,) – the name of the data source.

  • provider (Optional[str]) – the provider of the source to detect the bbox of, if None, the last one added will be used.

  • version (Optional[str]) – the version of the source to detect the bbox of, if None, the last one added will be used.

  • detect (bool) – Whether to detect the bbox of the source if it is not set.

  • strict (bool) – Raise an error if the adapter does not support bbox detection (such as dataframes). In that case, a warning will be logged instead.

Returns:

  • bbox (Tuple[np.float64,np.float64,np.float64,np.float64]) – the bounding box coordinates of the data. coordinates are returned as [xmin,ymin,xmax,ymax]

  • crs (int) – The ESPG code of the CRS of the coordinates returned in bbox