For a while now I have been trying to use r.mapcalc from the QGIS Processing Toolbox. However, the algorithm does not give me any output. I have tried several raster layers and different expressions, but the algorithm never outputs anything to the "Results Directory". Below there is an image that shows a simple example of algorithm setup. Maybe I am missing something, but I did not find anything similar online.
Not sure how to get it to work from the Processing Toolbox but instead, you could use the same tool from GRASS Tools. You can do this by:
- Running your QGIS Desktop 2.x.x with GRASS 7.x.x.
Then from the menubar, go to:
Plugins > GRASS > Open Mapset
New Mapsetto create a new one where you define a directory to store layers imported into GRASS.
- Import your raster using various methods such as
r.in.gdalto import via a path or
r.in.gdal.qgisto import a loaded raster in QGIS.
r.mapcalctool which comes with quite a nice GUI modeler. Set up your model:
Where "example" is the name of my raster, addition is the operator and adding a constant value of 1. Note that adding the connection lines can be tricky, you need to make sure the circle connection points which are initially red (when unconnected) turn grey (connected).
Once you made your model, give the output a name and click Run. It will tell you whether or not it ran successfully, if so then click View output to load the result into QGIS.