I am working with an existing DEM of a river and its surrounding area in QGIS (actually a virtual raster from four separate DEM TIF tiles).

My goal is to add a bridge's profile to the DEM. I have a point cloud (.las) of the area, and from that, have extracted the bridge's area using Cloud Compare using the clipping tool:

enter image description here

When I rasterize the bridge (in Cloud Compare), it also creates an elevation model around the bridge, and appears to assign it at sea-level. When I bring the bridge raster and the DEM into QGIS the bridge raster includes the sea-level generated elevation (outlined in red):

enter image description here

So my question is, how do I extract just the bridge and insert it into the existing DEM?

I mean, I guess I could just rebuild the entire DEM since I have the LAS files and include the bridge elevation, but this doesn't seem like it should be that hard. (having said that, I have spent the morning banging my head against this).

  • Sure and thanks for replying. I have a digital elevation model of an area that includes a river. However, the DEM does not include the bridges that cross the river. I'm trying to pull the bridge's elevation profile from the LIDAR point cloud and insert it into the DEM, so that when I export it from QGIS using the QGIS2THREEJS plug-in the bridge is rendered as a 3D object along with the surrounding terrain. It does have the correct elevation values, and the CRS's are the same (the DEM was created from the LAS). – Nick Malawskey Mar 2 '18 at 16:56
  • In the bridge raster, are all of the cells outside the bridge set to 0? If so, you'd want to convert those cells to no data before adding this raster to the original DEM. This post should help with that: gis.stackexchange.com/questions/167369/… – csk Mar 5 '18 at 18:34

Assuming both rasters align (same CRS and cell size*), a first option is:

  1. Retrieve the bridge's boundaries as vector from the bridge raster:

  2. Clip the bridge raster using the Clipper tool or gdalwarp:

  3. Merge the clipped raster into your main DEM. The bridge raster should be the last one in the order, so it will overwrite values in the first DEM. Make sure to ignore no_data values from the clipped bridge raster by using the argument -n nodata_value from the gdal_merge tool. See:

And a second option is:

  1. Reclassify the bridge raster. Set pixels which do not belong to the bridge as no_data (judging by the picture, there is a clear cut separation in elevation between pixels which belong to the bridge and which do not):

  2. Merge the reclassified raster into your main DEM (see step 3 from 'first option').

*If rasters do not have the same cell size, the merge process will resample the bridge raster to the DEM's resolution by the nearest neighbor method. See: What resampling method is used in gdal_merge?.

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.