8

Is it possible in QGIS either directly or via plugins to do a raster calculation including an if statement?

e.g., if raster1 > 0.3, then raster 1 * raster 2, else raster1 x raster3... something like that?

17

In QGIS Raster Calculator, the comparison return 0 (if false) or 1 (if true). So you can write a conditional using a sum of products.

((raster1@1 >0.3) * raster1@1 * raster2@1 ) + ((raster1@1 <=0.3) * raster1@1 * raster3@1 )
| improve this answer | |

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.