Bug report #14106
gdal info -stats are approximate if ".aux.xml" has been created.
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22112|
When Using gdalinfo with the "-stats" switch, raster statistics are exact only if the ".aux.xml" file has not been created. If the .aux.xml file has been created by qgis, statistics are approximate. This is a big problem as the only way to get the correct statistic is to close QGIS, delete the file and Start Qgis again. The processing "Raster Layer Statistics" works all the time.
#2 Updated by Nicolas Cadieux about 5 years ago
- File gdal_info.txt added
I have had this issues since at least QGIS 2.4 on multiplie Windows 7_64 machines all using the OSGeo4W64.
Steps to reproduce:
a: Start QGIS and go to a Directory will 1 tiff file only.
b: Go to raster/miscellaneous/information and add -stats: "gdalinfo H:/Dem_sol_151013.tiff -stats". Press enter. This will take a while(raster is 84GB): Minimum=-0.920, Maximum=787.450, Mean=335.777, StdDev=179.543
c:Close qgis while not saving the project: Dem_sol_151013.tiff.aux.xml is now in the directory
d:Open QGIS and try steps b: This will be fast: Minimum=-0.630, Maximum=778.970, Mean=335.169, StdDev=179.670
Results are identical when using gdalinfo -stats at the OSGeo4W shell.
Once the xml file is wrote, there is now way of getting the correct exact stats. As stat contained in the file override the exacts statistics:
If this is the default (and it should not be), it should be noted very clearly as this can really have an impact on research. Steps to have the correct specific stats should be available in GUI.
Hope this helps.
#4 Updated by Giovanni Manghi almost 5 years ago
- Target version deleted (
Future Release - High Priority)
- Status changed from Feedback to Open
- Category changed from GDAL Tools to Rasters
- File REAL_dtm_1km_6185_693.tif.aux.xml added
- File APROX_dtm_1km_6185_693.tif.aux.xml added
- Affected QGIS version changed from 2.12.2 to master
- Operating System deleted (
Windows 7_64 OSGeo4W64)
Alexander Bruy wrote:
Sorry I still can not reproduce it here. I always get same result with or without .aux.xml file.
If you get wrong results when running gdalinfo directly from command line, than this looks like GDAL bug.
I see the difference/issue, and you can see the related ticket comment here (and sample data)
by default QGIS computes stats in an approximate way, once the .aux.xml with approximate stats then gdalinfo will use it. The .aux.xml is update with real stats only if the user chooses "accuracy: actual/slower" in raster properties.
#6 Updated by Giovanni Manghi almost 2 years ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR