diff --git a/raster/r.mapcalc/r.mapcalc.html b/raster/r.mapcalc/r.mapcalc.html index 5f943f2abae..0f41f42b5db 100644 --- a/raster/r.mapcalc/r.mapcalc.html +++ b/raster/r.mapcalc/r.mapcalc.html @@ -619,15 +619,15 @@
-r.mapcalc follows the common GRASS behavior of raster MASK handling, -so the MASK is only applied when reading an existing GRASS raster map. +r.mapcalc follows the common GRASS behavior of raster mask handling, +so the mask is only applied when reading an existing GRASS raster map. This implies that, for example, the command:
r.mapcalc "elevation_exaggerated = elevation * 3"
However, when creating a map which is not based on any map, @@ -636,17 +636,19 @@
-If also in this case the MASK should be applied, an if() statement including the
-MASK should be used, e.g.:
+but it is not affected by an active raster mask.
+This is expected because, as mentioned above, the mask is only applied
+when reading, not when writing a raster map.
+If the raster mask should be applied in this case, an if()
+function including the mask raster should be used, e.g.
+(assuming the mask is called MASK
):
r.mapcalc "base_height = if(MASK, 200.0, null())"
+When testing expressions related to mask handling keep in mind that +when the raster mask is active, you don't see data in masked areas even if they are not NULL. See r.mask for details. diff --git a/raster/r.mapcalc/r3.mapcalc.html b/raster/r.mapcalc/r3.mapcalc.html index 742f5974384..46bcbcff3ae 100644 --- a/raster/r.mapcalc/r3.mapcalc.html +++ b/raster/r.mapcalc/r3.mapcalc.html @@ -449,15 +449,15 @@
-r3.mapcalc follows the common GRASS behavior of raster MASK handling, -so the MASK is only applied when reading an existing GRASS raster map. +r3.mapcalc follows the common GRASS behavior of raster mask handling, +so the mask is only applied when reading an existing GRASS raster map. This implies that, for example, the command:
r3.mapcalc "volume_amplified = volume * 3"
However, when creating a map which is not based on any map, @@ -466,19 +466,21 @@
-If also in this case the MASK should be applied, an if() statement including the
-MASK should be used, e.g.:
+but it is not affected by an active raster mask.
+This is expected because, as mentioned above, the mask is only applied
+when reading, not when writing a raster map.
+If the raster mask should be applied in this case, an if()
+function including the mask raster should be used, e.g.
+(assuming the mask is called MASK
):
r3.mapcalc "volume_const = if(MASK, 200.0, null())"
+When testing expressions related to mask handling keep in mind that +when the raster mask is active, you don't see data in masked areas even if they are not NULL. -See r.mask for details. +See r3.mask for details.
The pseudo-random number generator used by the rand() function can