[gdal-dev] Question on scaling between tif and vrt

Even Rouault even.rouault at mines-paris.org
Tue May 20 10:07:13 PDT 2014


Le mardi 20 mai 2014 02:22:12, Stephen Woodbridge a écrit :
> Even,
> 
> Thanks!
> 
> I didn't set his up, I just inherited the maintenance of it and I'm just
> trying to understand how it works and eventually make changes to it and
> fix some of the processing that does not seem to be grounded in a good
> process, which is looking like more and more of the code. :(
> 
> I get the point about the color table values need to be values from 0-n
> and you need 0-n entries in the color table.  Or you need to use LUT
> like you explained before.
> 
> What I was trying to understand is more along the lines of
> 
> input tif is Int16
> vrt is declared as Byte
> 
> How does GDAL deal with this? There are no errors or warnings. gdalinfo
> is reporting a Byte range of values for the vrt. I'm wondering how it is
> interpreting an arbitrary Int16 value into a Byte?
> 
> So some of the obvious guesses are:
> 
> 1. it is scaling them (you say no on this)
> 2. it is reading the Int16 and only using only the low or high order
> byte as the value?
> 3. something else?

It should clamp input values to the Byte range. So negative values in Int16 
will transform to 0, and ones > 255 will be clamped to 255.

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list