Any way to get/set the raster band scale and offset?

Kris Vanhoof

Hi! I am using rasterio to convert a number of geotiffs that were originally
created using GDAL.  To preserve the image metadata I'm currently using a combination of
the 'profile', 'descriptions' and 'units' properties of DatasetBase as well as 'tags()'.

However, it is unclear to me how to get and set the 'Scale' and 'Offset' value for a raster band.

Since there is a 'units' property in 'DatasetBase', I would have expected there to be a 'scales' and 'offsets'.

Likewise, in 'DatasetWriterBase' there is a 'set_band_unit()', but no 'set_band_offset()' or 'set_band_scale()'.

The GDAL functions that I would normally use are:



Is there any way to access these values using rasterio?

Join to automatically receive all group messages.