eoreader.utils.write

eoreader.utils.write

write(xds: xarray.core.dataarray.DataArray, path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.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

  • path (Union[str, CloudPath, Path]) – Path where to save it (directories should be existing)

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