write

Contents

write#

write(xds: DataArray, filepath: Union[str, CloudPath, Path], **kwargs) None[source]#

Overload of sertit.rasters.write() managing DASK in EOReader’s way.

>>> raster_path = "path/to/raster.tif"
>>> raster_out = "path/to/out.tif"

>>> # Read raster
>>> xds = read(raster_path)

>>> # Rewrite it
>>> write(xds, raster_out)
Parameters:
  • xds (xr.DataArray) – Path to the raster or a rasterio dataset or a xarray

  • filepath (AnyPathStrType) – Path where to save it (directories should be existing)

  • **kwargs – Overloading metadata, ie nodata=255 or dtype=np.uint8