hydromt.data_adapter.GeoDataFrameAdapter.detect_bbox#
- GeoDataFrameAdapter.detect_bbox(gdf: GeoDataFrame | None = 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 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