get_footprint#
- get_footprint(xds: str | CloudPath | Path | tuple[ndarray | MaskedArray, dict] | DataArray | Dataset | DatasetReader | DatasetWriter) GeoDataFrame[source]#
Get real footprint of the product (without nodata, in french == emprise utile)
Warning
With dask usage, this function is not lazy (yet) (depending on _vectorize)
- Parameters:
xds (AnyRasterType) – Path to the raster or a rasterio dataset or a xarray
- Returns:
Footprint as a GeoDataFrame
- Return type:
gpd.GeoDataFrame
Example
>>> raster_path = "path/to/raster.tif" >>> >>> footprint1 = get_footprint(raster_path) >>> >>> # or >>> with rasterio.open(raster_path) as ds: >>> footprint2 = get_footprint(ds) >>> >>> # Assert those two approaches give the same result >>> footprint1 == footprint2 True