[GRASS-SVN] r68268 - grass/trunk/raster/r.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 17 01:36:04 PDT 2016


Author: marisn
Date: 2016-04-17 01:36:04 -0700 (Sun, 17 Apr 2016)
New Revision: 68268

Modified:
   grass/trunk/raster/r.mapcalc/r.mapcalc.html
   grass/trunk/raster/r.mapcalc/r3.mapcalc.html
Log:
r.mapcalc: Improve documentation to clarify LHS/RHS issues. Fixes #2986 and #2770

Modified: grass/trunk/raster/r.mapcalc/r.mapcalc.html
===================================================================
--- grass/trunk/raster/r.mapcalc/r.mapcalc.html	2016-04-16 22:59:25 UTC (rev 68267)
+++ grass/trunk/raster/r.mapcalc/r.mapcalc.html	2016-04-17 08:36:04 UTC (rev 68268)
@@ -682,7 +682,21 @@
 
 <h2>KNOWN ISSUES</h2>
 
-Continuation lines must end with a <tt>\</tt> and have <em>no</em> trailing
+<p>The <em>result</em> variable on the left hand side of the equation should not
+appear in the <em>expression</em> on the right hand side.
+<div class="code"><pre>
+<s>mymap = if( mymap > 0, mymap, 0)</s>
+</pre></div>
+<p>Any maps generated by an r.mapcalc command only exist after the entire
+command has completed. All maps are generated concurrently, row-by-row
+(i.e. there is an implicit "for row in rows {...}" around the entire expression).
+Thus #, @ and [ ] operators can not be used on a map generated within same
+r.mapcalc command run.
+<div class="code"><pre>
+newmap = oldmap * 3.14
+<s>othermap = newmap[-1, 0] / newmap[1, 0]</s>
+</pre></div>
+<p>Continuation lines must end with a <tt>\</tt> and have <em>no</em> trailing
 white space (blanks or tabs). If the user does leave white space at the end of
 continuation lines, the error messages produced by <em>r.mapcalc</em> will
 be meaningless and the equation will not work as the user intended.

Modified: grass/trunk/raster/r.mapcalc/r3.mapcalc.html
===================================================================
--- grass/trunk/raster/r.mapcalc/r3.mapcalc.html	2016-04-16 22:59:25 UTC (rev 68267)
+++ grass/trunk/raster/r.mapcalc/r3.mapcalc.html	2016-04-17 08:36:04 UTC (rev 68268)
@@ -555,7 +555,14 @@
 
 <h2>KNOWN ISSUES</h2>
 
-Continuation lines must end with a <tt>\</tt> and have <em>no</em> trailing
+<p>The <em>result</em> variable on the left hand side of the equation should not
+appear in the <em>expression</em> on the right hand side.
+<p>Any maps generated by an r3.mapcalc command only exist after the entire
+command has completed. All maps are generated concurrently, row-by-row
+(i.e. there is an implicit "for row in rows {...}" around the entire expression).
+Thus #, @ and [ ] operators can not be used on a map generated within same
+r3.mapcalc command run.
+<p>Continuation lines must end with a <tt>\</tt> and have <em>no</em> trailing
 white space (blanks or tabs). If the user does leave white space at the end of
 continuation lines, the error messages produced by <em>r3.mapcalc</em> will
 be meaningless and the equation will not work as the user intended.



More information about the grass-commit mailing list