4

I downloaded GTOPO30 DEM archives from USGS(earthexplorer.usgs.gov/), and I just simply drag the file into QGIS, but somehow I find the elevation isn't the same with the actual scenery. I want to draw the terrain profile but the value isn't correct. I open the properties→ Metadata in QGIS and the maximum value is different from the official document.

Example: GTOPO30 w180 n90 enter image description here

The official specification is attached. The maximum value of this dem should be 6098, but at Qgis the Max is 4659.

Could anyone help me to deal with this error?

enter image description here

5

The stats were calculated approximately. There's a few ways to fix. Easiest way is to unset existing stats with gdal_edit and then recompute with gdalinfo:

gdal_edit -unsetstats gt30w180n90.tif

gdalinfo -stats gt30w180n90.tif
Driver: GTiff/GeoTIFF
Files: gt30w180n90.tif
       gt30w180n90.tif.aux.xml
Size is 4800, 6000
Coordinate System is:
GEOGCS["WGS 84",
<snip>
Band 1 Block=4800x1 Type=Int16, ColorInterp=Gray
  Minimum=1.000, Maximum=6098.000, Mean=448.899, StdDev=482.694
  NoData Value=-9999
  Metadata:
    STATISTICS_MAXIMUM=6098
    STATISTICS_MEAN=448.89852079342
    STATISTICS_MINIMUM=1
    STATISTICS_STDDEV=482.69366038176

Assuming you are using QGIS on Windows, installed from download.qgis.org. Open your Start Menu -> QGIS folder -> OSGeo4W Shell:

[Start Menu]

Then simply type:

gdal_edit -unsetstats [full path to]\gt30w180n90.tif 

e.g.

gdal_edit -unsetstats C:\Temp\gt30w180n90.tif 

Then

gdalinfo -stats [full path to]\gt30w180n90.tif
  • Hello, Luke I really appreciate your reply, but in fact, I am not familiar with Qgis. Is the gdal_edit you mentioned a plugin? Could you tell me how to use it or give me some suggestions? Thank you so much. – Ivan Lin Oct 11 '17 at 4:23
  • Oh!!!!!! It really works, thank you so much!!!!!!! That's quiet helpful~~~~~~~~~~~~~~~ – Ivan Lin Oct 11 '17 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.