hydromt.data_catalog.sources.GeoDataFrameSource.detect_bbox#
- GeoDataFrameSource.detect_bbox(gdf: GeoDataFrame | None = None) Tuple[float, float, float, float], <function _validate_bbox at 0x7f35298edd00>], int] [source]#
Detect the bounding box and crs of the dataset.
If no dataset is provided, it will be fetched acodring to the settings in the adapter. also see
hydromt.GeoDataframeAdapter.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.GeoDataframeAdapter.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