[gdal-dev] Wrong statistics from gdalinfo

Even Rouault even.rouault at spatialys.com
Wed Aug 27 06:06:51 PDT 2014


Jukka,

I suspect the file has been updated after first statistics have been computed, 
or perhaps they have been computed in -approx_stats mode.

gdalinfo -stats doesn't recompute statistics if they are already stored in the 
file.

I've done a "gdal_translate dem_10m.tif out.tif -co tiled=yes -co 
compress=deflate -stats" to force statistics recomputation

The updated stats are :
    STATISTICS_MAXIMUM=2002.291015625
    STATISTICS_MEAN=49.848418026241
    STATISTICS_MINIMUM=-1059.7540283203
    STATISTICS_STDDEV=163.15374152281

I've just added a -unsetstats flag to gdal_edit.py to clear statistics.

Even

Le mercredi 27 août 2014 12:03:07, Jukka Rahkonen a écrit :
> Hi,
> 
> My colleague found that gdalinfo -stats is giving wrong statistics for this
> 7.8 GB sized GeoTIFF file
> http://latuviitta.kapsi.fi/data/dem10m/dem_10m.tif
> 
> Gdalinfo -stats is listing
> 
> ...
>   Min=-999.999 Max=893.885
>   Minimum=-999.999, Maximum=893.885, Mean=41.967, StdDev=174.896
>   Metadata:
>     STATISTICS_MAXIMUM=893.88500976563
>     STATISTICS_MEAN=41.9674566748
>     STATISTICS_MINIMUM=-999.9990234375
>     STATISTICS_STDDEV=174.89632155312
> 
> However, there are higher values in this DEM and gdallocationinfo proves
> it:
> 
> C:\>gdallocationinfo -geoloc /vsicurl/
> http://latuviitta.kapsi.fi/data/dem10m/dem_10m.tif 278281 7689681
> Report:
>   Location: (22228P,9232L)
>   Band 1:
>     Value: 1005.67901611328
> 
> -Jukka Rahkonen-
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list