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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 8 14:03:18 PST 2013


Author: wenzeslaus
Date: 2013-11-08 14:03:18 -0800 (Fri, 08 Nov 2013)
New Revision: 58173

Modified:
   grass/trunk/raster/r.mapcalc/r.mapcalc.html
Log:
r.mapcalc: section in notes with small eval function example

Modified: grass/trunk/raster/r.mapcalc/r.mapcalc.html
===================================================================
--- grass/trunk/raster/r.mapcalc/r.mapcalc.html	2013-11-08 17:44:10 UTC (rev 58172)
+++ grass/trunk/raster/r.mapcalc/r.mapcalc.html	2013-11-08 22:03:18 UTC (rev 58173)
@@ -565,6 +565,19 @@
 you don't see data in masked areas even if they are not NULL.
 See <em><a href="r.mask.html">r.mask</a></em> for details.
 
+<h3>eval function</h3>
+If the output of the computation should be only one map
+but the expression is so complex that it is better to split it
+to several expressions, the <tt>eval</tt> function can be used:
+<div class="code"><pre>
+r.mapcalc >>EOF
+eval(elev_200 = elevation - 200, \
+     elev_5 = 5 * elevation, \
+     elev_p = pow(elev_5, 2))
+elevation_result = (0.5 * elev_200) + 0.8 * elev_p
+EOF
+</pre></div>
+
 <h3>Random number generator initialization</h3>
 <p>The environment variable GRASS_RND_SEED is read to initialize the
 random number generator.



More information about the grass-commit mailing list