Feature request #12984

raster calculator conditional statement

Added by ilaria marengo almost 2 years ago. Updated almost 2 years ago.

Status:Closed Start Date:06/17/2015
Priority:Normal Due date:
Assigned to:Victor Olaya % Done:


Target version:Future Release - Nice to have
Platform:windows 7 Resolution:duplicate
Platform version:professional Pull Request or Patch supplied:No
Status info: Tag:


It would be possible to implement a conditional statement like in SAGA grid calculator
to allow an easier setting of no data to a value? e.g. 0?
ifelse(gt(raster1, 0), raster1, 0)

if raster1 is gt (greater than) 0, then keep raster 1, else give the pixels value of 0

In GRASS in r.calc it is possible to run


but the original (not null) data strangely are different and i cannot understand what happens. The formula of Grass is the same one of the tool called fill nodata.

In QGIS, for raster calculator, i saw example like
(raster1 >190) * raster1

which in reality create a mask.
Is there any conditional statement in QGIS?


Updated by Nyall Dawson almost 2 years ago

  • Status changed from Open to Closed
  • Resolution set to duplicate

Duplicate of #4476

Also available in: Atom