RasterProduct.get_raster
- RasterProduct.get_raster(bands: str | List[str] = 'all', masks: str | List[str] = 'all', roi: Path | str | None = None, create_maskband: bool = True)[source]
Gets the path to the raster corresponding to this product. This method allows to crop the raster to a specified ROI and to apply the band masks.
- Parameters:
bands (str or [str], default="all") – List of bands ids to get in the generated raster. If “all”, all bands defined in the rastertype will be present in the raster.
masks (str or [str], default="all") – List of masks bands ids to get in the generated raster. If “all”, all masks bands defined in the rastertype will be present in the raster. If None, no mask band will be present in the rastertype.
roi (Path or str, optional, default=None) – Region of interest defined by a vector data (e.g. GeoJSON) for cropping the raster.
create_maskband (bool, optional, default=True) – Whether to create the VRT product with a maskband that is a composition of all the given masks.
- Returns:
- Raster path (either a path to a regular image or
a memory path such as /vsimem/…)
- Return type: