I need to adjust a DEM (raster) and I was wondering if the Raster Calculator is the right tool to use, and how?

I’m modelling floods in Xochimilco (Mexico) and via OpenStreetMap I have acquired the shapefile of water bodies. This shapefile I have converted to a raster with the same dimensions as the Digital Elevation Model: both rasters have the same projection and the same cell size (10x10).

My goal is to ‘burn in’ all bodies of water 1 meter into the DEM, so that the cells of the DEM with water become 1 meter lower than their initial value. Image: a part of the DEM

I figure that the I should assign the water raster a ‘value’ of 1, and then the formula in Raster Calculator would be [Original DEM – Water Raster = New DEM].

What steps should I take?

  • 2
    I don't know what you are really asking, what you describe is exactly what you would do! If you do not know how to use the raster calculator tool then you need to be reading the help file, there are lots of examples.
    – Hornbydd
    Oct 14, 2016 at 13:31
  • 2
    What software are you using? Both ArcGIS and QGIS have a Raster Calculator tool.
    – Dan C
    Oct 14, 2016 at 14:40
  • I've assigned the river-raster a value of 1 and used the formula OutRas = Raster("InRas1") - Raster("InRas2") in ArcGIS Raster Calculator. However, the river raster is smaller, and the output raster only shows the overlapping parts. The rest is 'missing'. How do I tackle this? Oct 14, 2016 at 15:08
  • 3
    Con(isnull (water),dem,dem-1)
    – FelixIP
    Oct 14, 2016 at 18:50

2 Answers 2


One approach would be to click on the Environment Settings button on the bottom of the Raster Calculator Window.

A new window pops up where you can choose the processing extent of your calculation.

enter image description here

Here you can choose between intersection, union, user specific... Additionally if rasters are loaded you can choose one of them. In your case I would choose the bigger one.

Source: Adding two raster datasets that overlap while maintaining extent of larger raster dataset?


It sounds like the null values (everything outside the water bodies) in the water body layer are throwing you off. You might want to first turn all null values to zero for example and then subtract the water bodies from your DEM.

#conditional in raster calculator to turn all null values to 0

#Now the calculation should leave you with desired coverage
"InRas1" - "InRas2"

and see @FelixIP's comment for the one-liner. Very nice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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