[GRASS-SVN] r69730 - grass/trunk/raster/r.mapcalc
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 25 19:04:33 PDT 2016
Author: wenzeslaus
Date: 2016-10-25 19:04:33 -0700 (Tue, 25 Oct 2016)
New Revision: 69730
Modified:
grass/trunk/raster/r.mapcalc/r.mapcalc.html
Log:
r.mapcalc: mention the LHS/RHS limits also in Notes and provide workaround (see #2986, r66548, r68268)
Modified: grass/trunk/raster/r.mapcalc/r.mapcalc.html
===================================================================
--- grass/trunk/raster/r.mapcalc/r.mapcalc.html 2016-10-26 01:18:01 UTC (rev 69729)
+++ grass/trunk/raster/r.mapcalc/r.mapcalc.html 2016-10-26 02:04:33 UTC (rev 69730)
@@ -608,6 +608,17 @@
If a user want to use the existing map, the name of the temporary variable
(map) must be changed.
+<h3>Using the same map for input and output results</h3>
+A map cannot be used both as an input and as an output as in
+this invalid expression <tt>oldmap = oldmap + 1</tt>, instead
+a subsequent rename using <em><a href="g.rename.html">g.rename</a></em> is
+needed when the same name is desired:
+
+<div class="code"><pre>
+r.mapcalc "newmap = oldmap + 1"
+g.rename raster=newmap,oldmap
+</pre></div>
+
<h3>Random number generator initialization</h3>
<p>The pseudo-random number generator used by the rand() function can
be initialised to a specific value using the <b>seed</b> option.
@@ -624,6 +635,7 @@
<p>Note that the rand() function will generate a fatal error if neither
the <b>seed</b> option nor the <b>-s</b> flag are given.
+
<h2>EXAMPLES</h2>
To compute the average of two raster map layers
@@ -721,6 +733,7 @@
(i.e. there is an implicit "for row in rows {...}" around the entire expression).
Thus the <tt>#</tt>, <tt>@</tt>, and <tt>[ ]</tt> operators cannot be used on a map
generated within same <em>r.mapcalc</em> command run.
+Consequently, the following (strikethrough code) does not work:
<div class="code"><pre>
newmap = oldmap * 3.14
More information about the grass-commit
mailing list