3

I am using the SAGA Raster Calculator in QGIS 2.6 to change NaN values to zero and that part is working great, however the specified 'if' value is being altered slightly. I have developed a work around but it seems a bit clumsy.

For example, I am using the following formula:

ifelse(eq(a,10), 10, 0)

yet when the the temporary file is created in QGIS the result ('Result' in the image below) appears as a raster with values from 0 to 9.99.

QGIS output - 'Result'

Through trial and error I have found that by using the following formula I can achieve the result I am looking for but it seems a bit clumsy.

ifelse(eq(a,10), 10.01001, 0)
  • Hello, I too am having a similar issue using the formula ifelse(gt(a,0), (a), b) where I get unexpected results. I wonder if there is a bug with this tool in this version. – geo derek Mar 15 '15 at 3:58
  • @geoderek I posed a separate but related question and xunilk (can't add two users) pointed me in the direction of the 'Value Tool' plugin which shows that what QGIS shows as the raster's max value is not necessarily an exact representation of the raster data itself. Or not even close in what I was producing. Hopefully someone will expand on this in the other post. – ImpactGIS Mar 31 '15 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.