- get_nodata_vector(ds: Union[str, tuple, DatasetReader], default_nodata: int = 0) GeoDataFrame #
Get the nodata vector of a raster as a vector.
Pay attention that every nodata pixel will appear too. If you want only the footprint of the raster, please use
>>> raster_path = "path/to/raster.tif" # Classified raster, with no data set to 255 >>> nodata1 = get_nodata_vec(raster_path) >>> # or >>> with rasterio.open(raster_path) as ds: >>> nodata2 = get_nodata_vec(ds) >>> nodata1 == nodata2 True
ds (PATH_ARR_DS) – Path to the raster, its dataset, its
xarrayor a tuple containing its array and metadata
default_nodata (int) – Default values for nodata in case of non existing in file
- Return type: