hydromt.data_adapter.RasterDatasetAdapter.detect_bbox#

RasterDatasetAdapter.detect_bbox(ds=None) Tuple[Tuple[float, float, float, float], 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.RasterdatasetAdapter.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.RasterdatasetAdapter.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