[GRASS-SVN] r34584 - grass/trunk/raster/r.watershed/front
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Nov 28 01:33:05 EST 2008
Author: hamish
Date: 2008-11-28 01:33:05 -0500 (Fri, 28 Nov 2008)
New Revision: 34584
Modified:
grass/trunk/raster/r.watershed/front/main.c
Log:
rename flag variables to something meaningful, sync front/ with r.watershed(1,2) in devbr6
Modified: grass/trunk/raster/r.watershed/front/main.c
===================================================================
--- grass/trunk/raster/r.watershed/front/main.c 2008-11-28 06:28:14 UTC (rev 34583)
+++ grass/trunk/raster/r.watershed/front/main.c 2008-11-28 06:33:05 UTC (rev 34584)
@@ -39,8 +39,8 @@
struct Option *opt13;
struct Option *opt14;
struct Option *opt15;
- struct Flag *flag1;
- struct Flag *flag2;
+ struct Flag *flag_flow;
+ struct Flag *flag_seg;
struct GModule *module;
G_gisinit(argv[0]);
@@ -176,19 +176,20 @@
opt15->gisprompt = "new,cell,raster";
opt15->guisection = _("Output_options");
- flag1 = G_define_flag();
- flag1->key = 'm';
- flag1->description =
+ flag_flow = G_define_flag();
+ flag_flow->key = '4';
+ flag_flow->description =
+ _("Allow only horizontal and vertical flow of water");
+
+ flag_seg = G_define_flag();
+ flag_seg->key = 'm';
+ flag_seg->description =
_("Enable disk swap memory option: Operation is slow");
- flag2 = G_define_flag();
- flag2->key = '4';
- flag2->description =
- _("Allow only horizontal and vertical flow of water");
-
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
+
/* Check option combinations */
/* Check for some output map */
@@ -225,12 +226,12 @@
/* Build command line */
sprintf(command, "%s/etc/", G_gisbase());
- if (flag1->answer)
+ if (flag_seg->answer)
strcat(command, "r.watershed.seg");
else
strcat(command, "r.watershed.ram");
- if (flag2->answer)
+ if (flag_flow->answer)
strcat(command, " -4");
if (opt1->answer) {
@@ -334,7 +335,7 @@
strcat(command, "\"");
}
- G_debug(1, "Mode: %s", flag1->answer ? "Segmented" : "All in RAM");
+ G_debug(1, "Mode: %s", flag_seg->answer ? "Segmented" : "All in RAM");
G_debug(1, "Running: %s", command);
ret = system(command);
@@ -344,32 +345,32 @@
if (opt8->answer)
write_hist(opt8->answer,
"Watershed accumulation: overland flow that traverses each cell",
- opt1->answer, flag1->answer);
+ opt1->answer, flag_seg->answer);
if (opt9->answer)
write_hist(opt9->answer,
"Watershed drainage direction (divided by 45deg)",
- opt1->answer, flag1->answer);
+ opt1->answer, flag_seg->answer);
if (opt10->answer)
write_hist(opt10->answer,
- "Watershed basins", opt1->answer, flag1->answer);
+ "Watershed basins", opt1->answer, flag_seg->answer);
if (opt11->answer)
write_hist(opt11->answer,
- "Watershed stream segments", opt1->answer, flag1->answer);
+ "Watershed stream segments", opt1->answer, flag_seg->answer);
if (opt12->answer)
write_hist(opt12->answer,
- "Watershed half-basins", opt1->answer, flag1->answer);
+ "Watershed half-basins", opt1->answer, flag_seg->answer);
if (opt13->answer)
write_hist(opt13->answer,
"Watershed visualization map (filtered accumulation map)",
- opt1->answer, flag1->answer);
+ opt1->answer, flag_seg->answer);
if (opt14->answer)
write_hist(opt14->answer,
"Watershed slope length and steepness (LS) factor",
- opt1->answer, flag1->answer);
+ opt1->answer, flag_seg->answer);
if (opt15->answer)
write_hist(opt15->answer,
"Watershed slope steepness (S) factor",
- opt1->answer, flag1->answer);
+ opt1->answer, flag_seg->answer);
exit(ret);
}
More information about the grass-commit
mailing list