[gdal-dev] What happens to pixel values > src_max under -scale?

Even Rouault even.rouault at mines-paris.org
Fri Feb 14 14:48:47 PST 2014


Le vendredi 14 février 2014 23:37:53, Sean Gillies a écrit :
> Hi all,
> 
> It seems that when gdal_translate scales e.g. -scale 0 6000 0 255, the
> values above 6000 also get set to 255. Can anyone confirm this for me?

It depnds. If the output type is Byte, then yes values will be clamped to 255 
(no other reasonable alternative). Otherwise values will just be multiplied by 
255 / 6000, so if 6000 is not the maximum value, the result value can be 
greater than 255.

> I
> don't see the destiny of those pixels explained in
> http://www.gdal.org/gdal_translate.html.
> 
> Thanks,

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


More information about the gdal-dev mailing list