[gdal-dev] Precision about scale/offset element in VRT file

Saâd HESSANE saad.hessane at gmail.com
Sat Mar 24 08:14:51 EDT 2012


Thank you all !

2012/3/23 Frank Warmerdam <warmerdam at pobox.com>

> On Fri, Mar 23, 2012 at 10:29 AM, Chaitanya kumar CH
> <chaitanya.ch at gmail.com> wrote:
> > Output pixel value = (raw pixel value * scale) + offset
>
> Exactly.
>
> The reason for scale and offset to exist is that "real world" measures
> like elevation, temperature, pressure are often represented in raster
> datasets as integer values rescaled from some original floating
> point values.  This is done for compactness in raster format and
> because many raster formats don't support floating point pixels at
> all.
>
> So for instance, if you have a dataset with temperatures between
> -20 and 100 you might record them in byte values such with an
> offset -20 and scale 2.0 which would provide for half degree
> precision over the range in byte values.
>
> So a temperature of 80 would be represented as byte value
> of "50".  The real temperature would be:
>
> 50 * 2 - 20 = 80
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Software Developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120324/39b1d321/attachment.html


More information about the gdal-dev mailing list