I'm struggeling a little bit with the rastercalculator tool of QGIS. At the moment I am working with a DSM and a DTM. My aim is to filter all wind turbines out of the DSM and replace it with the corresponding DTM data. Here im thinking about a calculation like:

If the height difference in "DSM" is like 50 m above the average in a certain area, replace it with pixels from "DTM"

So my question is, is this the right approach, or is there an easier way to deal with this problem?

1 Answer 1


This sounds like the right approach if you can rely on such a large height. You can then use the raster calculator for this type of operation. the expression would look like (with the correct raster names) :

("dsm@1"-"dtm@1">=50)*"dtm@1" + ("dsm@1"-"dtm@1"<50)*"dsm@1"

You couls also use mathematical morphology to erode and dilate your DSM in order to remove tall objects, but this would affect your other values.

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.