Trying to calculate aspect for south direction of my DEM. In this manual it is explained how to do it for nothern direction. But when I'm trying to use the expression of this type for southern:

"Aspect@1" >= 135 OR "Aspect@1" <= 225

I'm getting mistake. Both white and black values of resulting raster = 1.enter image description here

How to change expression to get raster which will give meunderstanding of slopes facing south? I'm working in QGIS 3.10.4, CRS - Pulkovo 1942 / Gauss-Kruger zone 11.

  • 1
    What is your expected output? 1 for south 0 for north?
    – BERA
    Apr 5, 2020 at 13:02
  • I'm expecting to get 1 for slopes facing south and 0 for the rest...
    – Burtsev
    Apr 5, 2020 at 13:03

1 Answer 1


I'm assuming you have created the aspect raster using for example: Raster terrain analysis - Aspect.

Then your expression will always evaluate to True/1 since all aspect values are between 0-360 and will either be >= 135 or <= 225

See: To select the range of values using Raster calculator in QGIS

I'm using 90-270 degrees for south:

(("aspect@1"<=90) AND ("aspect@1">=270))*0 + (("aspect@1">90) AND ("aspect@1"<270))*1

enter image description here

enter image description here

  • Thank you, @Bera! I do understand what your expression means, but I'm still getting an error. "An error occured while performing the calculation"...
    – Burtsev
    Apr 5, 2020 at 13:42
  • I had to save the aspect raster to disk (as a tif file), did not work with a temporary aspect raster. You are using a temp aspect raster?
    – BERA
    Apr 5, 2020 at 13:45
  • 2
    I've changed CRS to WGS 84 / UTM zone 41N, saved aspect raster to disk and finally got what I expected! Thank you so much! This trick took 5 hours out of my life...
    – Burtsev
    Apr 5, 2020 at 13:56

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.