Raster calculator (GRASS)
The code below uses the Toolbox SDK, which you can install with pip install toolbox-sdk.
Additional Python examples: using SDK, using Requests. If you prefer other programming language or need full API reference, check out Toolbox OpenAPI as well.
Docs
This tool performs calculations on single band rasters. The tool is based on r.mapcalc.
Input:
-
Single band GDAL supported raster, e.g. GeoTIFF. Add at least one raster file (to the “A” field). You can upload up to 8 raster files.
A – required field;
B – optional field;
C – optional field;
D – optional field;
E – optional field;
F – optional field;
G – optional field;
H – optional field;
Expression – required field. Use arithmetic (
+, -, /, *etc.) or logical (>, ==etc.) operators, or functions (log(x), if(x) `` etc.) to build an expression. The whole list is available `here <https://grass.osgeo.org/grass83/manuals/r.mapcalc.html>`_. Variables (rasters) should be specified as A, B, C etc. Example: ``(A+B)/C.
Output:
GeoTIFF file with the result of the calculation.
Try the tool in action
Click on the Demo button above the tool form. The fields are filled in with demo values.
Click on the Run button.