1

I'm using QGIS3. I have a raster layer for Koppen Geiger climate which has one band with values ranging from 1, 30. I want to make a new raster with only cells which have a value of the climates I am looking at, for instance; 10, 12, 13, 17, 19 to 24, and 28 to 30. I would like to keep the cells's values if possible in the new raster but if needs to be a binary result (if the value is 10, 12, 13, etc then the result is one, if not then zero) then that can work.

I'm assuming the way to do this is with the raster calculator and I've managed to get a result with two of the classes at a time with ("Beck_KG_V1_present_0p0083@1" = 29 OR ”Beck_KG_V1_present_0p0083@1" = 30 ) *"Beck_KG_V1_present_0p0083@1" but I know this isn't the right way to go about it. Thanks

JdP
  • 41
  • 5
  • 1
    You can also use the r.reclass tool (https://grass.osgeo.org/grass83/manuals/r.reclass.html) from GRASS within QGIS. – Nikos Sep 15 '23 at 10:13

1 Answers1

2

I recommend using Reclassify by table instead of raster calculator for this task.

Comrade Che
  • 7,091
  • 27
  • 58
  • Thanks a lot, I'll look into this. Out of interest, is this not something that's easy to do with raster calculator? If I had only five values that I wanted to extract, for example, I would have thought it would be fairly straight-forward to write an expression for this. – JdP Sep 15 '23 at 10:09
  • 1
    @JdP It's possible, but it's not the most user-friendly way to solve the task: https://gis.stackexchange.com/a/219605/35561 – Comrade Che Sep 15 '23 at 10:17