Re: [gdal-dev] -scale default

2023-09-08 Thread Michael Sumner
nice, thanks so much for the extended description. Cheers, Mike On Fri, 8 Sept 2023, 21:34 Even Rouault, wrote: > Michael, > > It turns out that gdal_translate was using 255.999 since the origins in > 2002 : > https://github.com/OSGeo/gdal/commit/47d859efb25da249b5d62eb8619c36134ae76572#diff-d5

Re: [gdal-dev] -scale default

2023-09-08 Thread Even Rouault
Michael, It turns out that gdal_translate was using 255.999 since the origins in 2002 : https://github.com/OSGeo/gdal/commit/47d859efb25da249b5d62eb8619c36134ae76572#diff-d57b4553312c88a736821448adc155e6797653b0d902bd42f9310572aa71f0b0R215 I suspect the reasoning was that, if you rounded valu

[gdal-dev] -scale default

2023-09-07 Thread Michael Sumner
Hi, I'm expecting `gdal_translate -scale` to emit values in the range 0,255 but it seems to be targeting 0,256. (All works as expected when using explicit src_min src_max dst_min dst_max). To see the output range on a simple example (see code at link below in case email garbles): from osgeo impo