hydromt.data_catalog.sources.GeoDatasetSource.detect_bbox#

GeoDatasetSource.detect_bbox(ds: Dataset | None = None) Tuple[float, float, float, float], <function _validate_bbox at 0x7f531a056020>], int][source]#

Detect the bounding box and crs of the dataset.

If no dataset is provided, it will be fetched according to the settings in the adapter. also see hydromt.GeoDatasetAdapter.get_data(). the coordinates are in the CRS of the dataset itself, which is also returned alongside the coordinates.

Parameters:

ds (xr.Dataset, xr.DataArray, Optional) – the dataset to detect the bounding box of. If none is provided, hydromt.GeoDatasetAdapter.get_data() will be used to fetch the it before detecting.

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