4

I'm working with QGIS and I want to reclassify a raster in different ranges.

Using the following statement does not work even recognized as valid

(2950 <= "dem_tallat @ 1"> = 3050) = 3000

Where I can find a document that shows the syntax to use for Raster Calculator?

1
  • 1
    try this one (2950 <= "dem_tallat@1" <= 3050) = 3000 - you obviously used wrong comparison sign Oct 21, 2014 at 15:16

2 Answers 2

4

There are a number of sources with examples showing what syntax can be used for rasters. Basically, common mathematical logics are used such as:

  • Mathematical (+, -, *, /)

  • Trigonometric (sin, cos, tan, asin, acos, atan)

  • Comparison (<, >, =, <=, >=)

  • Logical (AND, OR)

Here you can find how some of those syntax are used in some examples.

Other sources can be found in the QGIS documentation:

3
  • Ok, thanks. But I don't find any expression to satisfy my purpose. To recognise a range of values and transform this in another value
    – narmarant
    Oct 21, 2014 at 15:14
  • Have you tried what @SS_Rebelious suggested?
    – Joseph
    Oct 23, 2014 at 11:46
  • Yes, but doesn't works...
    – narmarant
    Oct 23, 2014 at 15:38
1

To map values from (2950-3050) into 3000 and preserving other values of dem_tallat :

(2950 <= "dem_tallat@1" AND  "dem_tallat@1" <= 3050)*3000 + (2950 > "dem_tallat@1" OR  "dem_tallat@1" > 3050)*"dem_tallat@1"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.