I want to compare my DEMs with each other (ASTER GDEM2 and SRTM4.1). I know, that the GDEM has some "holes" with wrong elevations (I found 3 of them in my working area). Now I need to know, if there are more of them to eventually correct them with the SRTM. I use SAGA, GRASS and QGIS.

  • compare them with what? with each other? one is you baseline and the other is faulty?
    – nickves
    Sep 11, 2012 at 13:07
  • right! I just want to draw the difference between them.
    – MartinMap
    Sep 11, 2012 at 13:10

2 Answers 2


You could start by getting the difference of the two DEMs. QGIS has a raster calculator tool that should come in handy. Just get tiles of both DEMs that cover the same area and subtract the values of one DEM from the other. That should get you a nice raster layer that shows the differences in elevation between the two DEMs.

  • 5
    Exactly, just subtract One DEM from the other. I would then represent it in QGIS or even reclassify it, using some tolerance around Zero. Something like If -5m < Result < 5m then consider that DEM's have the same value in that particular cell. Sep 11, 2012 at 13:20
  • 6
    (+1) That's a good start--and simple, too. Errors in DEMs are a little complicated: they result from elevation errors and from positional errors. If there is no positional error, then typically a screen based on a constant tolerance is good--but it shouldn't necessarily be around zero, because one DEM might have a (small) constant vertical shift relative to another. Use a tolerance around the median difference instead. In hilly areas, the positional error adds more variation where slopes are steeper, so the tolerance needs to be increased roughly in proportion to the tangent of the slope.
    – whuber
    Sep 11, 2012 at 14:28
  • I have a similar problem, but my rasters are overlapping only partially (raster B covers only part of raster A) and the "grid difference" tool will not work. Any ideas what I can do?
    – H.Wiener
    Nov 23, 2015 at 7:49

Let's say Raster1 is the correct, And Raster2 is the one you suspect it has faults.

They also both are in the same units (since you say both rasters are DEMs the z value should be in meters - I assume we're correct and we compare same things)

You can use rast calc from either package (qgis, grass, saga) to compare them eg:

deviation_rast  = abs( (raster1 - raster2) / raster1 * 100 ) 

each cell from the resulting raster will display the percentage which raster2 deviates from raster1.

After that you can reclassify deviation_rast based on your needs: eg

red -> deviation_rast_value > 75
orange -> deviation_rast_value > 50
yellow ->  deviation_rast_value > 25
green -> deviation_rast_value  > 0

to identify problematic areas - and to choose if you want to intervene or not

  • 9
    The ratio is not a good idea for DEMs with elevations near sea level: you will get many bogus results and completely undefined results wherever raster2 == 0. The right approach, for all DEMs, is just to subtract one raster from the other and screen for outliers (which can be done in many, many ways: consult stats.stackexchange.com for some methods).
    – whuber
    Sep 11, 2012 at 14:25

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.