[gdal-dev] GDAL 2.3.1 on linux disregarding nodata values
Even Rouault
even.rouault at spatialys.com
Fri Jul 6 03:14:43 PDT 2018
On jeudi 5 juillet 2018 14:22:16 CEST Tom van Tilburg wrote:
> I have a fresh gdal 2.3.1 build on a ubuntu 17.10 that tells me:
> > gdalinfo dem.tif -stats -mm
>
> [..snip...]
> Band 1 Block=2200x1 Type=Float32, ColorInterp=Gray
> Min=-2.233 Max=340282346638529993179660072199368212480.000 Computed
> Min/Max=-2.233,340282346638528859811704183484516925440.000
> Minimum=-2.233, Maximum=340282346638529993179660072199368212480.000,
> Mean=42029510023671999325552505715632898048.000,
> StdDev=111961692493879995008202507419807383552.000
> NoData Value=3.40282346638529011e+38
> Metadata:
> STATISTICS_MAXIMUM=3.4028234663853e+38
> STATISTICS_MEAN=4.2029510023672e+37
> STATISTICS_MINIMUM=-2.2330000400543
> STATISTICS_STDDEV=1.1196169249388e+38
ok, the issue is that nodata value (stored as text in GeoTIFF) is slightly
above the maximum value of a float32. Presumably due to rounding issues when
formatting it. I've pushed a fix to detect that situation and clamp it to the
max value of float32. A bit strange that the issue wasn't found on Windows
though.
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list