[GIS] Min and max values not correctly calculated for DEM using QGIS

demqgisstatistics

I'm working with DEM in QGIS and need to know the min and max values of my data.
In the Properties window, under the Metadata tab, the statistics section shows such values. However, I usually find some pixels with values higher than the max and lower than the min.

Is there another way to obtain these values?

I've tried this with several DEMs.

Best Answer

By default, QGIS does not calculate the full range for a raster. The range it calculates by default is 2% - 98%, see the 'Cumulative count cut' option in the 'Load min/max values' section of the dialog box. This is just the first option, which is why (I suspect) it is the default.

To get the full range, choose the option below it marked 'Min/max', then select 'Full' for Extent (default) and 'Actual (slower)' for Accuracy (the default is 'Estimate (faster)'). With these options all selected, click the 'Load' button at the bottom of this section of the dialog box. This loads the statistics and you will see them appear in the min max boxes in the appropriate part of the dialog box (depending on whether you are generating a single-band grey or pseudocolor palette).