revrt.utilities.base.save_data_using_custom_props#

save_data_using_custom_props(data, geotiff, shape, crs, transform, nodata=None, lock=None, **profile_kwargs)[source]#

Write to GeoTIFF file

Parameters:
  • data (array-like) – Data to write to GeoTIFF using LayeredFile profile.

  • geotiff (path-like) – Path to output GeoTIFF file.

  • shape (tuple) – Shape of output raster (height, width).

  • crs (str | dict) – Coordinate reference system of output raster.

  • transform (affine.Affine) – Affine transform of output raster.

  • nodata (int | float, optional) – Optional nodata value for the raster layer. By default, None, which does not add a “nodata” value.

  • lock (bool | `dask.distributed.Lock`, optional) – Lock to use to write data using dask. If not supplied, a single process is used for writing data to the GeoTIFF. By default, None.

  • **profile_kwargs – Additional keyword arguments to pass into writing the raster. The following attributes ar ignored (they are set using properties of the source LayeredFile):

    • nodata

    • transform

    • crs

    • count

    • width

    • height

Raises:

revrtValueError – If shape of provided data does not match shape of LayeredFile.