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

Alexander Bobkov alexander.e.bobkov at gmail.com
Tue Jun 23 03:37:12 PDT 2015


Even, Ray, thanks for the answers

22.06.2015 23:28, Ray Gardener пишет:
> The functions are to allow mapping between logical and physical pixel 
> values. This is very common in e.g. elevation DEMs.
>
> Applying them is done by the calling code. At least, I haven't seen 
> any routines in GDAL that
> would apply them for you.
>
> Ray
>
>
> On 6/22/2015 7:50 AM, Alexander Bobkov wrote:
>> 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#ab62e0761dde3e3b76f83155920275e4f> 
>>> 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?
>>
>> Best regards,
>> Alexander Bobkov
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150623/43123122/attachment.html>


More information about the gdal-dev mailing list