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
    try this one (2950 <= "dem_tallat@1" <= 3050) = 3000 - you obviously used wrong comparison sign – SS_Rebelious Oct 21 '14 at 15:16
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:

  • 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 '14 at 15:14
  • Have you tried what @SS_Rebelious suggested? – Joseph Oct 23 '14 at 11:46
  • Yes, but doesn't works... – narmarant Oct 23 '14 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, privacy policy and cookie policy

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