[GRASS-SVN] r70532 - grass/trunk/raster/r.terraflow
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Feb 11 13:22:16 PST 2017
Author: martinl
Date: 2017-02-11 13:22:16 -0800 (Sat, 11 Feb 2017)
New Revision: 70532
Modified:
grass/trunk/raster/r.terraflow/flow.cpp
grass/trunk/raster/r.terraflow/main.cpp
grass/trunk/raster/r.terraflow/r.terraflow.html
grass/trunk/raster/r.terraflow/weightWindow.cpp
Log:
r.terraflow: module description simplification
module updates
fix some warnings
Modified: grass/trunk/raster/r.terraflow/flow.cpp
===================================================================
--- grass/trunk/raster/r.terraflow/flow.cpp 2017-02-11 19:22:10 UTC (rev 70531)
+++ grass/trunk/raster/r.terraflow/flow.cpp 2017-02-11 21:22:16 UTC (rev 70532)
@@ -220,7 +220,7 @@
G_debug(1, "sweep stream size: %.2fMB",
(double)sweepstr->stream_len()*sizeof(sweepItem)/(1<<20));
- G_debug(1, " (%d items, item size=%d B\n ",
+ G_debug(1, " (%d items, item size=%ld B\n ",
(int)sweepstr->stream_len(), sizeof(sweepItem));;
if (stats)
Modified: grass/trunk/raster/r.terraflow/main.cpp
===================================================================
--- grass/trunk/raster/r.terraflow/main.cpp 2017-02-11 19:22:10 UTC (rev 70531)
+++ grass/trunk/raster/r.terraflow/main.cpp 2017-02-11 21:22:16 UTC (rev 70532)
@@ -134,7 +134,7 @@
mem->key = "memory";
mem->type = TYPE_INTEGER;
mem->required = NO;
- mem->answer = "300";
+ mem->answer = (char *) "300";
mem->description = _("Maximum memory to be used (in MB)");
/* temporary STREAM path */
@@ -153,7 +153,7 @@
stats_opt->key = "stats";
stats_opt->type = TYPE_STRING;
stats_opt->required = NO;
- stats_opt->description= _("Name of file containing runtime statistics");
+ stats_opt->description= _("Name for output file containing runtime statistics");
stats_opt->guisection = _("Outputs");
G_option_requires(input_elev, output_elev, output_dir, output_watershed,
@@ -240,8 +240,8 @@
}
#endif
#ifdef ELEV_FLOAT
- G_verbose_message( _("Elevation stored as FLOAT (%dB)"),
- sizeof(elevation_type));
+ G_verbose_message(_("Elevation stored as FLOAT (%ldB)"),
+ sizeof(elevation_type));
if (data_type == CELL_TYPE) {
G_warning(_("Raster map <%s> is of type CELL_TYPE "
"-- you should use r.terraflow.short"), opt->elev_grid);
@@ -421,10 +421,10 @@
G_debug(1, "total elements=%ld, nodata elements=%ld",
(long)nrows * ncols, nodata_count);
G_debug(1, "largest temporary files: ");
- G_debug(1, "\t\t FILL: %s [%ld elements, %dB each]",
+ G_debug(1, "\t\t FILL: %s [%ld elements, %ldB each]",
formatNumber(buf, fillmaxsize),
(long)nrows * ncols, sizeof(waterWindowType));
- G_debug(1, "\t\t FLOW: %s [%ld elements, %dB each]",
+ G_debug(1, "\t\t FLOW: %s [%ld elements, %ldB each]",
formatNumber(buf, flowmaxsize),
(long)nrows * ncols - nodata_count, sizeof(sweepItem));
G_debug(1, "Will need at least %s space available in %s",
@@ -461,14 +461,7 @@
module = G_define_module();
-#ifdef ELEV_SHORT
- module->label = _("Performs flow computation for massive grids.");
- module->description = _("Integer version.");
-#endif
-#ifdef ELEV_FLOAT
- module->label = _("Performs flow computation for massive grids.");
- module->description = _("Float version.");
-#endif
+ module->description = _("Performs flow computation for massive grids.");
G_add_keyword(_("raster"));
G_add_keyword(_("hydrology"));
G_add_keyword(_("flow"));
Modified: grass/trunk/raster/r.terraflow/r.terraflow.html
===================================================================
--- grass/trunk/raster/r.terraflow/r.terraflow.html 2017-02-11 19:22:10 UTC (rev 70531)
+++ grass/trunk/raster/r.terraflow/r.terraflow.html 2017-02-11 21:22:16 UTC (rev 70532)
@@ -72,11 +72,11 @@
<b>d8cut</b> option, then
the flow of this cell is routed to its neighbors using the SFD (D8)
model. This option affects only the flow accumulation raster and is
-meaningful only for MFD flow (i.e. if the -s flag is not used); If
+meaningful only for MFD flow (i.e. if the <b>-s</b> flag is not used); If
this option is used for SFD flow it is ignored. The default value of
<b>d8cut</b> is <i>infinity</i>.
-<p><em>r.terraflow</em> also computes the tci raster (topographic convergence
+<p><em>r.terraflow</em> also computes the <b>tci</b> raster (topographic convergence
index, defined as the logarithm of the ratio of flow accumulation and
local slope).
@@ -96,7 +96,7 @@
is the number of valid (not no-data) cells in the input elevation
raster).
<p>All these intermediate temporary files are stored in the path specified
-by the <b>STREAM_DIR</b> option. Note: <b>STREAM_DIR</b> must contain
+by the <b>directory</b> option. Note: <b>directory</b> must contain
enough free disk space in order to store up to 2 x 80N bytes.
<p>The <b>memory</b> option can be used to set the maximum amount of main
@@ -118,8 +118,7 @@
created by the user if needed.
<p>Hints concerning compilation with storage of elevations internally as
-shorts:
-<br>such a version uses less space (up to 60B per cell, up
+shorts: such a version uses less space (up to 60B per cell, up
to 60N intermediate file) and therefore is more space and time
efficient. <em>r.terraflow</em> is intended for use with floating
point raster data (FCELL), and <em>r.terraflow (short)</em> with integer
@@ -147,12 +146,10 @@
<h2>EXAMPLES</h2>
-Example for small area in North Carolina sample dataset:
+Example for small area in North Carolina sample dataset to calculate flow accumulation:
<div class="code"><pre>
g.region raster=elev_lid792_1m
-r.terraflow elevation=elev_lid792_1m filled=elev_lid792_1m_filled \
- direction=elev_lid792_1m_direction swatershed=elev_lid792_1m_swatershed \
- accumulation=elev_lid792_1m_accumulation tci=elev_lid792_1m_tci
+r.terraflow elevation=elev_lid792_1m accumulation=elev_lid792_1m_accumulation
</pre></div>
<div align="center" style="margin: 10px">
@@ -189,7 +186,35 @@
</pre></div>
+<h2>REFERENCES</h2>
+<ol>
+ <li> The <a href="http://www.cs.duke.edu/geo*/terraflow/">TerraFlow</a> project at Duke University
+ <li><A NAME="arge:drainage"
+ HREF="http://www.cs.duke.edu/geo*/terraflow/papers/alenex00_drainage.ps.gz">
+ I/O-efficient algorithms for problems on grid-based
+ terrains</a>. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In
+ <em>Proc. Workshop on Algorithm Engineering and Experimentation</em>,
+ 2000. To appear in <em>Journal of Experimental Algorithms</em>.
+
+ <li><A NAME="terraflow:acmgis01"
+ HREF="http://www.cs.duke.edu/geo*/terraflow/papers/acmgis01_terraflow.pdf">
+ Flow computation on massive grids</a>.
+ Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma,
+ Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In
+ <em>Proc. ACM Symposium on Advances in Geographic Information
+ Systems</em>, 2001.
+
+ <li><A NAME="terraflow:geoinformatica"
+ HREF="http://www.cs.duke.edu/geo*/terraflow/papers/journal_terraflow.pdf">
+ Flow computation on massive grid terrains</a>.
+ Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma,
+ Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe.
+ In <em>GeoInformatica, International Journal on
+ Advances of Computer Science for Geographic Information
+ Systems</em>, 7(4):283-313, December 2003.
+</ol>
+
<h2>SEE ALSO</h2>
<em>
@@ -202,8 +227,6 @@
<a href="r.watershed.html">r.watershed</a>
</em>
-
-
<h2>AUTHORS</h2>
<dl>
@@ -226,34 +249,4 @@
<dt>Contact: <a href="mailto:ltoma at bowdoin.edu "> Laura Toma</a></dt>
</dl>
-
-<h2>REFERENCES</h2>
-
-<ol>
- <li> The <a href="http://www.cs.duke.edu/geo*/terraflow/">TerraFlow</a> project at Duke University
- <li><A NAME="arge:drainage"
- HREF="http://www.cs.duke.edu/geo*/terraflow/papers/alenex00_drainage.ps.gz">
- I/O-efficient algorithms for problems on grid-based
- terrains</a>. Lars Arge, Laura Toma, and Jeffrey S. Vitter. In
- <em>Proc. Workshop on Algorithm Engineering and Experimentation</em>,
- 2000. To appear in <em>Journal of Experimental Algorithms</em>.
-
- <li><A NAME="terraflow:acmgis01"
- HREF="http://www.cs.duke.edu/geo*/terraflow/papers/acmgis01_terraflow.pdf">
- Flow computation on massive grids</a>.
- Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma,
- Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe. In
- <em>Proc. ACM Symposium on Advances in Geographic Information
- Systems</em>, 2001.
-
- <li><A NAME="terraflow:geoinformatica"
- HREF="http://www.cs.duke.edu/geo*/terraflow/papers/journal_terraflow.pdf">
- Flow computation on massive grid terrains</a>.
- Lars Arge, Jeffrey S. Chase, Patrick N. Halpin, Laura Toma,
- Jeffrey S. Vitter, Dean Urban and Rajiv Wickremesinghe.
- In <em>GeoInformatica, International Journal on
- Advances of Computer Science for Geographic Information
- Systems</em>, 7(4):283-313, December 2003.
-</ol>
-
<p><i>Last changed: $Date$</i>
Modified: grass/trunk/raster/r.terraflow/weightWindow.cpp
===================================================================
--- grass/trunk/raster/r.terraflow/weightWindow.cpp 2017-02-11 19:22:10 UTC (rev 70531)
+++ grass/trunk/raster/r.terraflow/weightWindow.cpp 2017-02-11 21:22:16 UTC (rev 70532)
@@ -192,8 +192,7 @@
const direction_type dir,
const int trustdir) {
- elevation_type elev_crt, elev_neighb, e_diff;
- dimension_type i_neighb, j_neighb;
+ elevation_type elev_crt, elev_neighb;
/* initialize all weights to 0 */
init();
@@ -210,10 +209,7 @@
for (short dj = -1; dj <= 1; dj++) {
/* grid coordinates and elevation of neighbour */
- i_neighb = i + di;
- j_neighb = j + dj;
elev_neighb = elevwin.get(di, dj);
- e_diff = (elevation_type)(elev_crt - elev_neighb);
skipit = ((di ==0) && (dj==0));
skipit |= (elev_crt < elev_neighb);
More information about the grass-commit
mailing list