Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to get the saga raster calculator in QGIS to spit out all values of a raster that are inferior to 10, and make all other values zero. I think the syntax is correct but I keep getting the original raster as an output which is definitely not what I want. Here is the code I am using:

    ifelse(lt(a,10),a,0)

I'm thinking there must be a problem with the way I am referencing the raster? I read in the SAGA help pdf that "if you have four grid map layers in your ‘Input’ list, they will be referred to by a, b, c, and d." So I'm not sure what I'm doing wrong.

share|improve this question

1 Answer 1

I think the SAGA help file is outdated? a,b,c, was replaced by g1, g2, g3, etc. I tried in SAGA directly using the Grid calculator module and it worked with using the formula:

ifelse(lt(g1,10),g1,0)

Hope that helps also in QGIS!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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