r.mapcalc.simple(1)
r.mapcalc.simple π
okay bestie, gather round, because this is the GRASS GIS User's Manual page for r.mapcalc.simple(1) and honestly? it's giving β¨convenienceβ¨ in the best way.
πΈ NAME πΈ
r.mapcalc.simple β Calculates a new raster map from a simple r.mapcalc expression. literally that's the whole gig π«Ά
π·οΈ KEYWORDS π·οΈ
raster, algebra, simple
β¨ SYNOPSIS β¨
r.mapcalc.simple
r.mapcalc.simple --help
r.mapcalc.simple [-sqc] expression=string [a=name] [b=name]
[c=name] [d=name] [e=name] [f=name] output=name [seed=integer]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π Flags π
-sβ Generate random seed (and heads up bestie: the result is non-deterministic, so like, don't expect the same thing twice π)-qβ Quote the map names-cβ Case sensitive variable names--overwriteβ Allow output files to overwrite existing files (iconic but dangerous energy)--helpβ Print usage summary--verboseβ Verbose module output--quietβ Quiet module output--uiβ Force launching GUI dialog
π§ Parameters π§
expression=string[required] β Formula (e.g.A-BorA*C+B)a=nameβ Name of input A raster mapb=nameβ Name of input B raster mapc=nameβ Name of input C raster mapd=nameβ Name of input D raster mape=nameβ Name of input E raster mapf=nameβ Name of input F raster mapoutput=name[required] β Name for output raster mapseed=integerβ Seed forrand()function
π DESCRIPTION π
So r.mapcalc.simple provides a wrapper to r.mapcalc. Up to 6 maps can be combined using simple expressions. no cap.
The general syntax for the expression follows r.mapcalc expression format β for example, A + B or exp(A + B) are valid. The variables A, B, ..., F represent raster maps which are provided as options a, b, ..., f. cute, right?
The result name β i.e. the output raster map β is provided using the option output and, unlike r.mapcalc, it is not part of the expression. π«Ά
This module is meant for convenience (for users and programmers) while the r.mapcalc module is a better choice for more complex expressions and advanced usage. so like, know your lane, bestie π
π NOTES π
Differences to r.mapcalc module:
- The input raster map names and the output map raster name are separate from the expression (formula) which uses generic variable names (
A,B,C, ...). - The output raster name is not included in the expression.
- The expression is expected to be a single short one liner without the function
eval().
Differences to r.mapcalc.simple module in GRASS GIS 5 and 6:
- The primary purpose is not being a GUI front end to
r.mapcalc, but a wrapper which allows easy building of interfaces tor.mapcalc(including GUIs). - Whitespace (most notably spaces) are allowed (in the same way as for
r.mapcalc). - The variable names are case-insensitive to allow the original uppercase as well as lowercase as in option names (unless the
-cflag is used). - Option names for each map are just one letter (not
amap, etc.). - Output option name is
outputas for other modules (notoutfile). - Raster map names can be optionally quoted (the
-qflag). - There is no expert mode (which was just running
r.mapcalc). - The expression option is first, so it is possible to omit its name in the command line (just like with
r.mapcalc). - Overwriting of outputs is done in the same way as with other modules, so there is no flag to not overwrite outputs.
π EXAMPLES π
π Basic examples π
r.mapcalc.simple expression="0" output=zeros
r.mapcalc.simple expression="1" output=ones
r.mapcalc.simple expression="2" output=twos
r.mapcalc.simple expression="A + B + C" a=zeros b=ones c=twos output=result1
r.mapcalc.simple expression="(A * B) / 2 + 3 * C" a=zeros b=ones c=twos output=result2
Figure: r.mapcalc.simple graphical user interface
π¦ Example expressions π¦
Addition:
A + B
No spaces around operators are not recommended for readability, but allowed in the expression:
A+B
More complex expression with a function:
exp(A+C)+(B-2)*7
π SEE ALSO π
r.mapcalc, r3.mapcalc, t.rast.mapcalc, g.region
π AUTHORS π
- Vaclav Petras, NCSU GeoForAll Lab
- Michael Barton, Arizona State University (updated to GRASS 5.7)
- R. Brunzema (original 5.0 Bash version)
πΎ SOURCE CODE πΎ
Available at: r.mapcalc.simple source code (history)
Accessed: Saturday Jan 17 05:41:52 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
okay that's the whole page, bestie, you ate that π
β¨ so anyway, this was the GRASS 8.4.2 manual for r.mapcalc.simple(1) β go forth and calculate some rasters, periodt. ππ¦π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms