I need to add a value to a dem file along a polyline feature or within a polygon. How can I add 100 to the values of the raster cells intersected by my line feature or within my polygon feature.

I would like to know how to do this in QGIS, if possible.


1 Answer 1


Using GDAL:

  1. Create a mask from the resulting vector stuff (polyline feature or within a polygon) http://www.gdal.org/gdal_rasterize.html
  2. Synchronize the map area, the raster width of the mask with the config of the dem http://www.gdal.org/gdal_translate.html
  3. Use gdal_calc.py with the mask condition to add 100 to your dem. http://www.gdal.org/gdal_calc.html

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.