<div dir="ltr"><div>I have a fresh gdal 2.3.1 build on a ubuntu 17.10 that tells me:</div><div><br></div><div><span style="font-family:monospace,monospace">> gdalinfo dem.tif -stats -mm<br></span></div><div><span style="font-family:monospace,monospace">[..snip...]</span></div><div><span style="font-family:monospace,monospace">Band 1 Block=2200x1 Type=Float32, ColorInterp=Gray<br>  Min=-2.233 Max=340282346638529993179660072199368212480.000   Computed Min/Max=-2.233,340282346638528859811704183484516925440.000<br>  Minimum=-2.233, Maximum=340282346638529993179660072199368212480.000, Mean=42029510023671999325552505715632898048.000, StdDev=111961692493879995008202507419807383552.000<br>  NoData Value=3.40282346638529011e+38<br>  Metadata:<br>    STATISTICS_MAXIMUM=3.4028234663853e+38<br>    STATISTICS_MEAN=4.2029510023672e+37<br>    STATISTICS_MINIMUM=-2.2330000400543<br>    STATISTICS_STDDEV=1.1196169249388e+38</span><br></div><div><br></div><div>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.<br></div><div><br></div><div>When doing the same thing on my osgeo4w64 with gdal 2.2.4 or gdal 2.4.0 (dev) it tells me:</div><div>
<div>
<div><br></div><div><span style="font-family:monospace,monospace">> gdalinfo dem.tif -stats -mm<br></span></div><div><span style="font-family:monospace,monospace">[..snip...]</span></div><span style="font-family:monospace,monospace">

</span></div><span style="font-family:monospace,monospace">

</span></div><div><span style="font-family:monospace,monospace">Band 1 Block=2200x1 Type=Float32, ColorInterp=Gray<br>  Min=-2.233 Max=2.176   Computed Min/Max=-2.233,2.176<br>  Minimum=-2.233, Maximum=2.176, Mean=0.169, StdDev=0.316<br>  NoData Value=3.40282346638529011e+38<br>  Metadata:<br>    STATISTICS_MAXIMUM=2.1760001182556<br>    STATISTICS_MEAN=0.16871771630616<br>    STATISTICS_MINIMUM=-2.2330000400543<br>    STATISTICS_STDDEV=0.31600319455862</span></div><div><br></div><div>This seems to be the correct answer.</div><div><br></div><div>Worth noticing: there is another gdal libs from package on the linux machine:</div><div><span style="font-family:monospace,monospace">gdal-data                                  2.2.1+dfsg-2build3</span></div><div><span style="font-family:monospace,monospace">libgdal20                                  2.2.1+dfsg-2build3</span></div><div><span style="font-family:monospace,monospace">python3-gdal                               2.2.1+dfsg-2build3</span></div><div><br></div><div>Any thoughts?</div><div><br></div><div>Best,</div><div> Tom<br></div></div>