Feature request #4476
Add a 2 cases if() command to Raster Calculator
|Pull Request or Patch supplied:||No||Resolution:|
|Easy fix?:||No||Copied to github as #:||14403|
An if() command with 2 cases output would be most useful:
if(condition, result1, result2)
where the output value is result1 if condition==T and result2 otherwise.
#7 Updated by Médéric RIBREUX almost 5 years ago
- Status changed from Open to Feedback
Hello, bug triage...
the raster calculator can handle conditions but the expression is not so easy to understand:
("[email protected]" < 50) * 1 + ("[email protected]" >= 50) * 2
will make cells with a value less than 50 have a value of 1 and cells with a value greater than or equal to 50 have a value of 2.
Was your feature request about a way to have conditions in the raster calculator or about the syntax of the condition ?