[GRASS-SVN] r54533 - in grass/trunk/raster: r.cost r.walk

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 5 06:04:56 PST 2013


Author: martinl
Date: 2013-01-05 06:04:55 -0800 (Sat, 05 Jan 2013)
New Revision: 54533

Modified:
   grass/trunk/raster/r.cost/main.c
   grass/trunk/raster/r.cost/r.cost.html
   grass/trunk/raster/r.walk/main.c
   grass/trunk/raster/r.walk/r.walk.html
Log:
r.walk/r.cost: sync parameters
               update manual pages


Modified: grass/trunk/raster/r.cost/main.c
===================================================================
--- grass/trunk/raster/r.cost/main.c	2013-01-05 12:26:48 UTC (rev 54532)
+++ grass/trunk/raster/r.cost/main.c	2013-01-05 14:04:55 UTC (rev 54533)
@@ -146,7 +146,7 @@
 
     opt2 = G_define_standard_option(G_OPT_R_INPUT);
     opt2->description =
-	_("Name of raster map containing grid cell cost information");
+	_("Name of input raster map containing grid cell cost information");
 
     opt1 = G_define_standard_option(G_OPT_R_OUTPUT);
 
@@ -154,15 +154,13 @@
     opt12->key = "nearest";
     opt12->required = NO;
     opt12->description =
-	_("Name of output raster map with nearest start point");
+	_("Name for output raster map with nearest start point");
 
-    opt11 = G_define_option();
+    opt11 = G_define_standard_option(G_OPT_R_OUTPUT);
     opt11->key = "outdir";
-    opt11->type = TYPE_STRING;
     opt11->required = NO;
-    opt11->gisprompt = "new,cell,raster";
     opt11->description =
-	_("Name of output raster map to contain movement directions");
+	_("Name for output raster map to contain movement directions");
 
     opt7 = G_define_standard_option(G_OPT_V_INPUT);
     opt7->key = "start_points";
@@ -173,7 +171,7 @@
     opt8 = G_define_standard_option(G_OPT_V_INPUT);
     opt8->key = "stop_points";
     opt8->required = NO;
-    opt8->label = _("Name of stop vector points map");
+    opt8->label = _("Name of stopping vector points map");
     opt8->guisection = _("Stop");
 
     opt9 = G_define_standard_option(G_OPT_R_INPUT);
@@ -182,22 +180,18 @@
     opt9->description = _("Name of starting raster points map");
     opt9->guisection = _("Start");
 
-    opt3 = G_define_option();
-    opt3->key = "coordinate";
-    opt3->type = TYPE_STRING;
-    opt3->key_desc = "x,y";
+    opt3 = G_define_standard_option(G_OPT_M_COORDS);
+    opt3->key = "start_coordinate";
     opt3->multiple = YES;
     opt3->description =
-	_("Map grid coordinates of a starting point (E,N)");
+	_("Coordinates of starting point(s) (E,N)");
     opt3->guisection = _("Start");
 
-    opt4 = G_define_option();
+    opt4 = G_define_standard_option(G_OPT_M_COORDS);
     opt4->key = "stop_coordinate";
-    opt4->type = TYPE_STRING;
-    opt4->key_desc = "x,y";
     opt4->multiple = YES;
     opt4->description =
-	_("Map grid coordinates of a stopping point (E,N)");
+	_("Coordinates of stopping point(s) (E,N)");
     opt4->guisection = _("Stop");
 
     opt5 = G_define_option();

Modified: grass/trunk/raster/r.cost/r.cost.html
===================================================================
--- grass/trunk/raster/r.cost/r.cost.html	2013-01-05 12:26:48 UTC (rev 54532)
+++ grass/trunk/raster/r.cost/r.cost.html	2013-01-05 14:04:55 UTC (rev 54533)
@@ -25,17 +25,17 @@
 
 <p><em>r.cost</em> can be run with three different methods of identifying the
 starting point(s). One or more points (geographic coordinate pairs) can be
-provided as specified <b>coordinate</b>s on the command line, from a vector
+provided as specified <b>start_coordinate</b> on the command line, from a vector
 points file, or from a raster map.
 All non-NULL cells are considered to be starting points.
 
-Each <em>x,y</em> <b>coordinate</b> pair gives the geographic location of a
+Each <em>x,y</em> <b>start_coordinate</b> pair gives the geographic location of a
 point from which the transportation cost should be figured. As many points as
 desired can be entered by the user. These starting points can also be read
 from a vector points file through the <b>start_points</b> option or from a
 raster map through the <b>start_rast</b> option.
 <p><em>r.cost</em> will stop cumulating costs when either <b>max_cost</b> is reached,
-or one of the stop points given with <b>stop_coordinates</b> is reached.
+or one of the stop points given with <b>stop_coordinate</b> is reached.
 Alternatively, the stop points can be read from a vector points file with the
 <b>stop_points</b> option. During execution, once the cumulative cost to all 
 stopping points has been determined, processing stops.
@@ -53,7 +53,7 @@
 retained as null cells in the output map.
 
 <p>As <em>r.cost</em> can run for a very long time, it can be useful to 
-use the <b>-v</b> verbose flag to track progress.
+use the <b>--v</b> verbose flag to track progress.
 
 <p>The Knight's move (<b>-k</b> flag) may be used to improve the accuracy of
 the output. In the diagram below, the center location (<tt>O</tt>) represents a
@@ -226,7 +226,7 @@
 <h2>Movement Direction</h2>
 <p>The movement direction surface is created to record the sequence of
 movements that created the cost accumulation surface. Without it 
-<em>r.drain</em> would not correctly create a path from an end point 
+<em><a href="r.drain.html">r.drain</a></em> would not correctly create a path from an end point 
 back to the start point. The direction of each cell points towards 
 the next cell. The directions are recorded as degrees CCW from East:
 <div class="code"><pre>
@@ -238,31 +238,26 @@
 </pre></div>
 
 <p>
-Once <em>r.cost</em> computes the cumulative cost map, <em>r.drain</em>
+Once <em>r.cost</em> computes the cumulative cost map, <em><a href="r.drain.html">r.drain</a></em>
 can be used to find the minimum cost path. Make sure to use the <b>-d</b> flag
 and the movement direction raster map when running r.drain to ensure
 the path is computed according to the proper movement directions.
 
 <h2>SEE ALSO</h2>
 
-<em><a href="r.drain.html">r.drain</a></em>,
-<em><a href="r.walk.html">r.walk</a></em>,
-<em><a href="r.in.ascii.html">r.in.ascii</a></em>,
-<em><a href="r.mapcalc.html">r.mapcalc</a></em>,
-<em><a href="r.out.ascii.html">r.out.ascii</a></em>
+<em>
+<a href="r.drain.html">r.drain</a>,
+<a href="r.walk.html">r.walk</a>,
+<a href="r.in.ascii.html">r.in.ascii</a>,
+<a href="r.mapcalc.html">r.mapcalc</a>,
+<a href="r.out.ascii.html">r.out.ascii</a>
+</em>
 
 <h2>AUTHOR</h2>
 
-Antony Awaida,<br>
-Intelligent Engineering<br>
-Systems Laboratory,<br>
-M.I.T.<br>
-<br>
-James Westervelt,<br>
-U.S.Army Construction Engineering Research Laboratory
+Antony Awaida, Intelligent Engineering Systems Laboratory, M.I.T.<br>
+James Westervelt, U.S.Army Construction Engineering Research Laboratory<br>
+Updated for Grass 5 by Pierre de Mouveaux (pmx at audiovu.com) 
 
-<p>Updated for Grass 5<br>
-Pierre de Mouveaux (pmx at audiovu.com) 
-
-
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/trunk/raster/r.walk/main.c
===================================================================
--- grass/trunk/raster/r.walk/main.c	2013-01-05 12:26:48 UTC (rev 54532)
+++ grass/trunk/raster/r.walk/main.c	2013-01-05 14:04:55 UTC (rev 54533)
@@ -179,75 +179,62 @@
     G_add_keyword(_("raster"));
     G_add_keyword(_("cost surface"));
     G_add_keyword(_("cumulative costs"));
-    module->description =
-	_("Outputs a raster map layer showing the "
-	  "anisotropic cumulative cost of moving between different "
+    module->label =
+	_("Outputs a raster map showing the "
+	  "anisotropic cumulative cost.");
+    module->description = _("Computes anisotropic cumulative cost of moving between different "
 	  "geographic locations on an input elevation raster map "
-	  "layer whose cell category values represent elevation "
+	  "whose cell category values represent elevation "
 	  "combined with an input raster map layer whose cell "
 	  "values represent friction cost.");
 
-    opt12 = G_define_standard_option(G_OPT_R_INPUT);
-    opt12->key = "elevation";
-    opt12->required = YES;
-    opt12->description = _("Name of elevation input raster map");
+    opt12 = G_define_standard_option(G_OPT_R_ELEV);
 
     opt2 = G_define_standard_option(G_OPT_R_INPUT);
     opt2->key = "friction";
-    opt2->required = YES;
     opt2->description =
 	_("Name of input raster map containing friction costs");
 
     opt1 = G_define_standard_option(G_OPT_R_OUTPUT);
-    opt1->required = YES;
-    opt1->label = _("output map with walking costs");
-    opt1->description = _("Name of output raster map to contain walking costs");
+    opt1->description = _("Name for output raster map to contain walking costs");
 
-    opt11 = G_define_option();
+    opt11 = G_define_standard_option(G_OPT_R_OUTPUT);
     opt11->key = "outdir";
-    opt11->type = TYPE_STRING;
     opt11->required = NO;
-    opt11->gisprompt = "new,cell,raster";
     opt11->description =
-	_("Name of output raster map to contain movement directions");
+	_("Name for output raster map to contain movement directions");
 
-    opt7 = G_define_option();
+    opt7 = G_define_standard_option(G_OPT_V_INPUT);
     opt7->key = "start_points";
-    opt7->type = TYPE_STRING;
-    opt7->gisprompt = "old,vector,vector";
     opt7->required = NO;
-    opt7->description = _("Starting points vector map");
+    opt7->label = _("Name of starting vector points map");
+    opt7->guisection = _("Start");
 
-    opt8 = G_define_option();
+    opt8 = G_define_standard_option(G_OPT_V_INPUT);
     opt8->key = "stop_points";
-    opt8->type = TYPE_STRING;
-    opt8->gisprompt = "old,vector,vector";
     opt8->required = NO;
-    opt8->description = _("Stop points vector map");
+    opt8->label = _("Name of stopping vector points map");
+    opt8->guisection = _("Stop");
 
-    opt9 = G_define_option();
+    opt9 = G_define_standard_option(G_OPT_R_INPUT);
     opt9->key = "start_rast";
-    opt9->type = TYPE_STRING;
     opt9->required = NO;
-    opt9->gisprompt = "old,cell,raster";
-    opt9->description =
-	_("Starting points raster map");
+    opt9->description = _("Name of starting raster points map");
+    opt9->guisection = _("Start");
 
-    opt3 = G_define_option();
-    opt3->key = "coordinate";
-    opt3->type = TYPE_STRING;
-    opt3->key_desc = "x,y";
+    opt3 = G_define_standard_option(G_OPT_M_COORDS);
+    opt3->key = "start_coordinate";
     opt3->multiple = YES;
     opt3->description =
-	_("The map E and N grid coordinates of a starting point (E,N)");
+	_("Coordinates of starting point(s) (E,N)");
+    opt3->guisection = _("Start");
 
-    opt4 = G_define_option();
+    opt4 = G_define_standard_option(G_OPT_M_COORDS);
     opt4->key = "stop_coordinate";
-    opt4->type = TYPE_STRING;
-    opt4->key_desc = "x,y";
     opt4->multiple = YES;
     opt4->description =
-	_("The map E and N grid coordinates of a stopping point (E,N)");
+	_("Coordinates of stopping point(s) (E,N)");
+    opt4->guisection = _("Stop");
 
     opt5 = G_define_option();
     opt5->key = "max_cost";
@@ -255,7 +242,7 @@
     opt5->required = NO;
     opt5->multiple = NO;
     opt5->answer = "0";
-    opt5->description = _("An optional maximum cumulative cost");
+    opt5->description = _("Maximum cumulative cost");
 
     opt6 = G_define_option();
     opt6->key = "null_cost";

Modified: grass/trunk/raster/r.walk/r.walk.html
===================================================================
--- grass/trunk/raster/r.walk/r.walk.html	2013-01-05 12:26:48 UTC (rev 54532)
+++ grass/trunk/raster/r.walk/r.walk.html	2013-01-05 14:04:55 UTC (rev 54533)
@@ -1,32 +1,42 @@
 <h2>DESCRIPTION</h2>
 
-<em>r.walk</em> outputs 1) a raster map layer showing the lowest
+<em>r.walk</em> outputs 1) a raster map showing the lowest
 cumulative cost of moving between each cell and the user-specified
-starting points and 2) a second raster map layer showing the movement 
+starting points and 2) a second raster map showing the movement 
 direction to the next cell on the path back to the start point (see 
 <a href="#move">Movement Direction</a>). It uses an input elevation 
-raster map layer whose cell category values represent elevation, 
-combined with a second input raster map layer whose cell values 
+raster map whose cell category values represent elevation, 
+combined with a second input raster map whose cell values 
 represent friction costs.
 
-This function is similar to <em>r.cost</em>, but in addiction to a
-friction map, it considers an anisotropic travel time due to the
-different walking speed associated with downhill and uphill movements.
 <p>
+This function is similar to <em><a href="r.cost.html">r.cost</a></em>,
+but in addiction to a friction map, it considers an anisotropic travel
+time due to the different walking speed associated with downhill and
+uphill movements.
+
+<h2>NOTES</h2>
+
+<p>
 The formula from Aitken 1977/Langmuir 1984 (based on Naismith's rule
 for walking times) has been used to estimate the cost parameters of
 specific slope intervals:
 
-<p>T= [(a)*(Delta S)] + [(b)*(Delta H uphill)] + [(c)*(Delta H moderate downhill)] + [(d)*(Delta H steep downhill)]
-<p>where:<br>
-T is time of movement in seconds,<br>
-Delta S is the distance covered in meters,<br>
-Delta H is the altitude difference in meter.
-<p> 
+<div class="code"><pre>
+T= [(a)*(Delta S)] + [(b)*(Delta H uphill)] + [(c)*(Delta H moderate downhill)] + [(d)*(Delta H steep downhill)]
+</pre></div>
 
-The a, b, c, d parameters take in account movement speed in the different
-conditions and are linked to:
+where:
+<ul>
+  <li><tt>T</tt> is time of movement in seconds,</li>
+  <li><tt>Delta S</tt> is the distance covered in meters,</li>
+  <li><tt>Delta H</tt> is the altitude difference in meter.</li>
+</ul>
 
+<p>
+The a, b, c, d <b>walk_coeff</b> parameters take in account
+movement speed in the different conditions and are linked to:
+
 <ul>
   <li>a: underfoot condition (a=1/walking_speed)</li>
   <li>b: underfoot condition and cost associated to movement uphill</li>
@@ -36,16 +46,18 @@
 
 It has been proved that moving downhill is favourable up to a specific
 slope value threshold, after that it becomes unfavourable. The default
-slope value threshold (slope factor) is -0.2125, corresponding to
-tan(-12), calibrated on human behaviour (>5 and <12
-degrees: moderate downhill; >12 degrees: steep downhill). The
-default values for a, b, c, d are those proposed by Langmuir (0.72, 6.0,
-1.9998, -1.9998), based on man walking effort in standard
-conditions.<p>
-The lambda parameter of the linear equation combining movement and
-friction costs:<br>
+slope value threshold (<b>slope_factor</b>) is -0.2125, corresponding
+to tan(-12), calibrated on human behaviour (>5 and <12 degrees:
+moderate downhill; >12 degrees: steep downhill). The default values
+for a, b, c, d <b>walk_coeff</b> parameters are those proposed by
+Langmuir (0.72, 6.0, 1.9998, -1.9998), based on man walking effort in
+standard conditions.
 
-total cost = movement time cost + (lambda) * friction costs<br>
+<p>The <b>lambda</b> parameter of the linear equation
+combining movement and friction costs:<br>
+<div class="code"><pre>
+total cost = movement time cost + (lambda) * friction costs
+</pre></div>
 must be set in the option section of <em>r.walk</em>.
 <p>
 For a more accurate result, the "knight's move" option can be used
@@ -70,7 +82,7 @@
 <h2>Movement Direction</h2>
 <p>The movement direction surface is created to record the sequence of
 movements that created the cost accumulation surface. Without it 
-<em>r.drain</em> would not correctly create a path from an end point 
+<em><a href="r.drain.html">r.drain</a></em> would not correctly create a path from an end point 
 back to the start point. The direction of each cell points towards 
 the next cell. The directions are recorded as degrees CCW from East:
 <div class="code"><pre>
@@ -84,21 +96,14 @@
 <p>
 Once <em>r.walk</em> computes the cumulative cost map as a linear
 combination of friction cost (from friction map) and the altitude and
-distance covered (from the digital elevation model), <em>r.drain</em>
-can be used to find the minimum cost path. Make sure to use the <b>-d</b> flag
-and the movement direction raster map when running r.drain to ensure
-the path is computed according to the proper movement directions.
+distance covered (from the digital elevation
+model), <em><a href="r.drain.html">r.drain</a></em> can be used to
+find the minimum cost path. Make sure to use the <b>-d</b> flag and
+the movement direction raster map when
+running <em><a href="r.drain.html">r.drain</a></em> to ensure the path
+is computed according to the proper movement directions.
 
 
-<h2>SEE ALSO</h2>
-
-<em><a href="r.cost.html">r.cost</a></em>,
-<em><a href="r.drain.html">r.drain</a></em>,
-<em><a href="r.in.ascii.html">r.in.ascii</a></em>,
-<em><a href="r.mapcalc.html">r.mapcalc</a></em>,
-<em><a href="r.out.ascii.html">r.out.ascii</a></em>
-
-
 <h2>REFERENCES</h2>
 
 <ul>
@@ -112,29 +117,34 @@
  Sports Council/MLTB. Cordee, Leicester.
 </ul>
 
+<h2>SEE ALSO</h2>
+
+<em>
+<a href="r.cost.html">r.cost</a>,
+<a href="r.drain.html">r.drain</a>,
+<a href="r.in.ascii.html">r.in.ascii</a>,
+<a href="r.mapcalc.html">r.mapcalc</a>,
+<a href="r.out.ascii.html">r.out.ascii</a>
+</em>
+
+
 <h2>AUTHORS</h2>
 
-<b>Based on r.cost written by :</b>
-<p>Antony Awaida,<br>
-Intelligent Engineering<br>
-Systems Laboratory,<br>
-M.I.T.<br>
-<br>
-James Westervelt,<br>
-U.S.Army Construction Engineering Research Laboratory
+<b>Based on r.cost written by :</b><br>
+Antony Awaida, Intelligent Engineering, Systems Laboratory, M.I.T.<br>
+James Westervelt, U.S.Army Construction Engineering Research Laboratory<br>
+Updated for Grass 5 by Pierre de Mouveaux (pmx at audiovu.com)
 
-<p>Updated for Grass 5<br>
-Pierre de Mouveaux (pmx at audiovu.com)
+<p><b>Initial version of r.walk:</b><br>
+Steno Fontanari, 2002
 
-<p><b>Initial version of r.walk:</b>
-<p>Steno Fontanari, 2002
-
-<p><b>Current version of r.walk:</b>
-<p>Franceschetti Simone, Sorrentino Diego, Mussi Fabiano and Pasolli Mattia<br>
+<p><b>Current version of r.walk:</b><br>
+Franceschetti Simone, Sorrentino Diego, Mussi Fabiano and Pasolli Mattia<br>
 Correction by: Fontanari Steno, Napolitano Maurizio and  Flor Roberto<br>
 In collaboration with: Franchi Matteo, Vaglia Beatrice, Bartucca Luisa, Fava Valentina and Tolotti Mathias, 2004
 
-<p><b>Updated for Grass 6.1</b>
-<p>Roberto Flor and Markus Neteler
+<p><b>Updated for Grass 6.1:</b><br>
+Roberto Flor and Markus Neteler
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>



More information about the grass-commit mailing list