[gdal-dev] Set/Get Scale and Offset in GDALRasterBand

Even Rouault even.rouault at spatialys.com
Mon Jun 22 08:01:24 PDT 2015


Le lundi 22 juin 2015 16:50:33, Alexander Bobkov a écrit :
> Hi,
> 
> What is the intended usage of methods
> SetScale/GetScale/SetOffset/GetOffset of the GDALRasterBand class?
> 
> Documentation says that
> 
> > This value (in combination with the GetOffset()
> > <http://www.gdal.org/classGDALRasterBand.html#ab62e0761dde3e3b76f83155920
> > 275e4f> value) is used to transform raw pixel values into the units
> > returned by GetUnits(). For example this might be used to store
> > elevations in GUInt16 bands with a precision of 0.1, and starting from
> > -100.
> > 
> > Units value = (raw value * scale) + offset
> 
> Who is responsible for applying the formula: client code before/after
> RasterIO operation, or driver code inside IReadBlock/IWriteBlock methods?

Client code after RasterIO(GF_Read, ...)/ReadBlock() or before 
RasterIO(GF_Write, ...)/WriteBlock()

> 
> Best regards,
> Alexander Bobkov

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list