[GRASS-SVN] r54545 - grass/trunk/raster/r.drain
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 6 04:19:15 PST 2013
Author: martinl
Date: 2013-01-06 04:19:15 -0800 (Sun, 06 Jan 2013)
New Revision: 54545
Modified:
grass/trunk/raster/r.drain/main.c
grass/trunk/raster/r.drain/r.drain.html
Log:
r.drain: description cosmetics (elevation X cost surface)
more guisections
Modified: grass/trunk/raster/r.drain/main.c
===================================================================
--- grass/trunk/raster/r.drain/main.c 2013-01-06 11:50:12 UTC (rev 54544)
+++ grass/trunk/raster/r.drain/main.c 2013-01-06 12:19:15 UTC (rev 54545)
@@ -106,25 +106,28 @@
module = G_define_module();
G_add_keyword(_("raster"));
G_add_keyword(_("hydrology"));
+ G_add_keyword(_("cost surface"));
module->description =
- _("Traces a flow through an elevation model on a raster map.");
+ _("Traces a flow through an elevation model or cost surface on a raster map.");
- opt1 = G_define_standard_option(G_OPT_R_ELEV);
- opt1->key = "input";
+ opt1 = G_define_standard_option(G_OPT_R_INPUT);
+ opt1->description = _("Name of input elevation or cost surface raster map");
opt3 = G_define_standard_option(G_OPT_R_INPUT);
opt3->key = "indir";
opt3->description =
_("Name of input movement direction map associated with the cost surface");
opt3->required = NO;
-
+ opt3->guisection = _("Cost surface");
+
opt2 = G_define_standard_option(G_OPT_R_OUTPUT);
opt4 = G_define_standard_option(G_OPT_V_OUTPUT);
opt4->key = "vector_output";
opt4->required = NO;
- opt4->description =
- _("Name for output drain vector map (recommended for cost surface made using knight's move)");
+ opt4->label =
+ _("Name for output drain vector map");
+ opt4->description = _("Recommended for cost surface made using knight's move");
coordopt = G_define_standard_option(G_OPT_M_COORDS);
coordopt->key = "start_coordinates";
@@ -135,6 +138,7 @@
vpointopt->key = "start_points";
vpointopt->required = NO;
vpointopt->label = _("Name of starting vector points map(s)");
+ vpointopt->description = NULL;
vpointopt->guisection = _("Start");
flag1 = G_define_flag();
@@ -144,15 +148,18 @@
flag2 = G_define_flag();
flag2->key = 'a';
flag2->description = _("Accumulate input values along the path");
+ flag2->guisection = _("Path settings");
flag3 = G_define_flag();
flag3->key = 'n';
flag3->description = _("Count cell numbers along the path");
+ flag3->guisection = _("Path settings");
flag4 = G_define_flag();
flag4->key = 'd';
flag4->description =
- _("The input surface is a cost surface (if checked, a direction surface must also be specified");
+ _("The input raster map is a cost surface (direction surface must also be specified)");
+ flag4->guisection = _("Cost surface");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -163,7 +170,7 @@
if (flag4->answer) {
costmode = 1;
- G_verbose_message(_("Directional drain selected... checking for direction raster"));
+ G_verbose_message(_("Directional drain selected... checking for direction raster map"));
}
else {
G_verbose_message(_("Surface/Hydrology drain selected"));
@@ -171,14 +178,14 @@
if (costmode == 1) {
if (!opt3->answer) {
- G_fatal_error(_("Direction raster not specified, if direction flag is on, "
- "a direction raster must be given"));
+ G_fatal_error(_("Direction raster map <%s> not specified, if direction flag is on, "
+ "a direction raster must be given"), opt3->key);
}
strcpy(dir_name, opt3->answer);
}
if (costmode == 0) {
if (opt3->answer) {
- G_fatal_error(_("Direction map <%s> should not be specified for Surface/Hydrology drains"),
+ G_fatal_error(_("Direction raster map <%s> should not be specified for Surface/Hydrology drains"),
opt3->answer);
}
}
@@ -245,8 +252,6 @@
struct bound_box box;
int type;
- G_message(_("Reading vector map <%s> with start points..."), vpointopt->answers[i]);
-
Points = Vect_new_line_struct();
Cats = Vect_new_cats_struct();
@@ -255,6 +260,9 @@
if (1 > Vect_open_old(&In, vpointopt->answers[i], ""))
G_fatal_error(_("Unable to open vector map <%s>"), vpointopt->answers[i]);
+ G_message(_("Reading vector map <%s> with start points..."),
+ Vect_get_full_name(&In));
+
Vect_rewind(&In);
Vect_region_box(&window, &box);
Modified: grass/trunk/raster/r.drain/r.drain.html
===================================================================
--- grass/trunk/raster/r.drain/r.drain.html 2013-01-06 11:50:12 UTC (rev 54544)
+++ grass/trunk/raster/r.drain/r.drain.html 2013-01-06 12:19:15 UTC (rev 54545)
@@ -1,7 +1,8 @@
<h2>DESCRIPTION</h2>
-<em>r.drain</em> traces a flow through a least-cost path in an elevation
-model. Alternatively, a movement direction map can be used with the
+<em>r.drain</em> traces a flow through a least-cost path in an
+elevation model or cost surface. For cost surfaces, a movement
+direction map must be specified with the
<b>indir</b> option and the <b>-d</b> flag to trace a flow path following
the given directions. Such a movement direction map can be generated with
<em><a href="r.walk.html">r.walk</a></em>,
@@ -9,22 +10,24 @@
<em><a href="r.slope.aspect.html">r.slope.aspect</a></em> or
<em><a href="r.watershed.html">r.watershed</a></em>.
+<p>
The <b>output</b> raster map will show one or more least-cost paths
between each user-provided location(s) and the minima (low category
-values) in the raster <b>input</b> map. If the -d flag is used the output
-least-cost paths will be found using the direction raster map. By
-default, the <b>output</b> will be an integer CELL map with <tt>1</tt>
-along the least cost path, and null cells elsewhere.
+values) in the raster <b>input</b> map. If the <b>-d</b> flag is used
+the output least-cost paths will be found using the direction raster
+map. By default, the <b>output</b> will be an integer CELL map with
+category 1 along the least cost path, and null cells elsewhere.
<p>With the <b>-c</b> (<em>copy</em>) flag, the input raster map cell values are
copied verbatim along the path. With the <b>-a</b> (<em>accumulate</em>)
flag, the accumulated cell value from the starting point up to the current
cell is written on output. With either the <b>-c</b> or the <b>-a</b> flags, the
-<b>output</b> map is created with the same cell type as the <b>input</b> map (integer,
-float or double).
-With the <b>-n</b> (<em>number</em>) flag, the cells are numbered consecutively from the
-starting point to the final point.
-The <b>-c</b>, <b>-a</b>, and <b>-n</b> flags are mutually incompatible.
+<b>output</b> map is created with the same cell type as
+the <b>input</b> raster map (integer, float or double). With
+the <b>-n</b> (<em>number</em>) flag, the cells are numbered
+consecutively from the starting point to the final point.
+The <b>-c</b>, <b>-a</b>, and <b>-n</b> flags are mutually
+incompatible.
<p>For an elevation surface, the path is calculated by choosing the
steeper "slope" between adjacent cells. The slope calculation
More information about the grass-commit
mailing list