2

I'm no expert in QGIS, I'm more into engineering.

I'm building a 2D hydraulic model and I would like to add the building footprints (elevated) to my DEM, so flow will go around structures in the model. I've actually done this before in QGIS but can't for the life of me get it to work again.

I've digitized buildings as polygons, added an arbitrary elevation to them, then tried a range of things to fuse that info with my DEM to no avail.

  • I'm afraid I don't know the specific commands/tools/details in QGIS. However what you need to do is add a field to your buildings and give it a uniform value you want to increase the DEM height (say, plus 20m). Convert the buildings to raster (Convert Vector to Raster tool), using the field you added as the raster value field. Ensure in the resulting raster that all non-building cells are set to 0. Then use the Raster Calculator to add that building raster to your DEM. Note nodata raster cells will result in nodata result cells (hence making sure 0 instead of nodata). – Chris W Jun 13 '15 at 1:49
  • Thanks Chris W. This is the process I was working through and it almost works. Except when I add the two rasters together, the resulting raster extents is only that of the building layer, not my original DEM. The operation works, it adds the building raster to the original dem except it clips the original dem at the outer boundary of the building raster?? – Ian Boland Jun 15 '15 at 12:59
  • Tools vary, but often results involving two rasters default to the extent of the smaller raster. As I said, I'm not very familiar with QGIS, but the documentation has a screenshot of the raster calculator. Under Result Layer there's a button that says "Current Layer Extent". I think you need to highlight the DEM layer on the left side and then click that button, or perhaps if you click it there will be a choice of which extent to use. – Chris W Jun 15 '15 at 20:00
1

I believe you want to change the values of the pixels to reflect the elevation change. To do this, I would make a copy of the DEM, and create a layer that would contain the building envelopes. From there, I would select the pixels from the DEM that fell within the building envelopes, and add whatever value necessary to get the water to flow around them. You can't really add the geometries of the buildings to the DEM, you just have to use the geometries of the buildings as an overlay, for editing the pixels contained within.

So, import the DEM, then in the raster menu find the Conversion-Polygonize function. This will turn the pixels into polygons, you can then select polygons inside the building envelopes to change the values to what you want. You can then rasterize that file if you wish. I think is probably what you may have done in the past.

  • Thanks for the response. I'm not entirely sure how to go about doing what you suggested. that said, I know this can be done because I was able to do it before, I just rarely use QGIS so I forget how things are done! – Ian Boland Jun 12 '15 at 20:35
  • I apologize for my suggestion above. I worked through this a little bit, and have a somewhat convoluted answer. I am unable to produce screenshots of the steps at this time. Import the DEM, then in the raster menu find the Conversion-Polygonize function. This will turn the pixels into polygons, you can then select polygons inside the building envelopes to change the values to what you want. You can then rasterize that file if you wish. I think is probably what you may have done in the past. – jbgramm Jun 14 '15 at 0:45
1

You could rasterize the building envelopes, then use the raster calculator to add its elevation values to the DEM.

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.