[gdal-dev] GDAL 2.3.1 on linux disregarding nodata values

Tom van Tilburg tom.van.tilburg at gmail.com
Thu Jul 5 05:22:16 PDT 2018


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

Obviously, cells with nodata value are included in the stats, although
rounded. This seems wrong to me and I know gdal propagates the values with
for instance gdal_translate.

When doing the same thing on my osgeo4w64 with gdal 2.2.4 or gdal 2.4.0
(dev) it tells me:

> gdalinfo dem.tif -stats -mm
[..snip...]
Band 1 Block=2200x1 Type=Float32, ColorInterp=Gray
  Min=-2.233 Max=2.176   Computed Min/Max=-2.233,2.176
  Minimum=-2.233, Maximum=2.176, Mean=0.169, StdDev=0.316
  NoData Value=3.40282346638529011e+38
  Metadata:
    STATISTICS_MAXIMUM=2.1760001182556
    STATISTICS_MEAN=0.16871771630616
    STATISTICS_MINIMUM=-2.2330000400543
    STATISTICS_STDDEV=0.31600319455862

This seems to be the correct answer.

Worth noticing: there is another gdal libs from package on the linux
machine:
gdal-data                                  2.2.1+dfsg-2build3
libgdal20                                  2.2.1+dfsg-2build3
python3-gdal                               2.2.1+dfsg-2build3

Any thoughts?

Best,
 Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180705/a293a072/attachment.html>


More information about the gdal-dev mailing list