In order to analyse the visibility of objects behind the orange objects, I would like to add a height of 3 meters in the area of the polygons to the Digital Elevation Model (GeoTIFF). Is there a possibility? Would there also be a possibility to have different heights at different corners?
2 Answers
Two ways to update the target raster directly without creating a temporary raster layer:
- Use gdal_rasterize https://gdal.org/programs/gdal_rasterize.html with
-add
option.
-add
Instead of burning a new value, this adds the new value to the existing raster. Suitable for heatmaps for instance.
Usage:
gdal_rasterize -burn 3 -add polygons.json dem.tif
- Use the same GDAL tool from the QGIS user interface "Processing-Vector conversion-Rasterize (Overwrite With Fixed Value)"
-
let's assume I have little experiece with commmand lines :) is this a python command or where do it insert that command? thank you!– MarekMar 20 at 12:07
-
It is a command line utility and you must insert it into a Linux/Windows/Mac command line. You must have the command line tools installed into your system and if you use QGIS you should have them already. What it you operating system and how did you install QGIS? Mar 20 at 12:12
-
1
You can use Rasterize (Vector to Raster) from GDAL to turn your polygons into a raster with a specific value where those polygons are.
Make sure your vector is in the same CRS as your raster first, then in the Rasterize tool set the vertical and horizontal resolution to the same as your raster, and choose your raster as a source for output extent. Then change "A fixed value to burn" to 3, and run the tool. You can then just use the raster calculator to add this new raster to your other raster.
If you want to different values for each object based on a certain field in the Attribute Table, you can also just choose that field under "Field to use for a burn-in value".
-
2