I am trying to perform a simple raster calculation on an elevation layer to occlude certain values. I have used the following expression:

( ( "clipped_elev@1">500) AND ("clipped_elev@1"<1000))*"clipped_elev@1"

On QGIS 3.8.0 and after the update to 3.8.1 I get pixels with either 0 or 1 which is not the expected result. I tried the raster calculator from both the Raster menu and from processing. I tried the same expression on the LTR version and got the expected raster result.

Has the syntax for the raster calculator change in 3.8 or is this a bug that needs to be reported?

1 Answer 1


The changelog for QGIS 3.8 has two entries that might be relevant:

My recommendations:

  1. Review the two changelog entries I linked to, to see if there's any chance that those changes would intentionally cause your issue. Particularly look into the documentation for the raster boolean algorithms, and see if they work differently from the way the raster calculator worked before. Maybe the raster calculator was changed to match the new algorithms (without being documented). If that's the case, you can make a suggestion about improving the raster calculator documentation here.
  2. If step 1 doesn't resolve your issue, check if it's one of the known raster calculator bugs. If your issue hasn't already been reported, make a new bug report.
  • The fix was related to the bug fix you linked to. I turned off Open CL and the raster calculator worked just fine. Does this mean that the closed issue needs to be reopened again?
    – Techie_Gus
    Commented Jul 23, 2019 at 16:04
  • Yes, it sounds like the bug isn't actually fixed :(. Bug reports are on github now, so update it on github instead of the old report I linked to.
    – csk
    Commented Jul 23, 2019 at 16:08

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.