1

I have a raster layer with values ranging from 0.00597303 to 0.102894 and I want to assign specific number representing a group to specific range of values:

Group 4: x >= 0.1
Group 3: 0.01 <= x < 0.1
Group 2: x < 0.01

I am using the following syntax:

("Ri_Q50@1" >= 0.1) * 4 + (("Ri_Q50@1" >= 0.01) AND ("Ri_Q50@1" < 0.1)) * 3 + ("Ri_Q50@1" < 0.01) * 2

However, the output file only has assigned group 2 and 3 but not the 4th group (x >= 0.1). What could be the reason?

Note: When I use the Raster pixels to points and check the output point layer there is 12 points having exceeded the condition for 4th group - ie 12 pixels has value above 0.1).

3
  • I am using Qgis.
    – Petr
    Commented Jul 30, 2019 at 13:53
  • Welcome to GIS:SE @Petr! Your expression looks fine, which QGIS version are you using?
    – Joseph
    Commented Jul 30, 2019 at 14:04
  • I've tried 3.4 long term release and 3.8 Zanzibar but both gives the same output. Any ideas?
    – Petr
    Commented Jul 31, 2019 at 6:50

1 Answer 1

1

An alternative to Raster Calculator, you can use Reclassify by table tool from Processing toolbox -> Raster Analysis -> Reclassify by table. Then use the range of values that you want to reclassify to integer values as you can see in the example below:

enter image description here

Make sure to select the correct Range boundaries from the tool above. This example uses min < value <= max. You may need to change it based on your desired analysis.

1
  • Thanks for tip, however the Range boundaries of this tool does not allow me to reclassify the raster according to my needs: Group 4: x >= 0.1 Group 3: 0.01 <= x < 0.1 Group 2: x < 0.01
    – Petr
    Commented Aug 1, 2019 at 10:23

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.