[GRASS-SVN] r59430 - grass-addons/grass7/raster/r.stream.segment
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 27 08:10:50 PDT 2014
Author: madi
Date: 2014-03-27 08:10:48 -0700 (Thu, 27 Mar 2014)
New Revision: 59430
Modified:
grass-addons/grass7/raster/r.stream.segment/main.c
grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html
Log:
cleanup and consistency with other r.stream modules improved
Modified: grass-addons/grass7/raster/r.stream.segment/main.c
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/main.c 2014-03-27 15:10:37 UTC (rev 59429)
+++ grass-addons/grass7/raster/r.stream.segment/main.c 2014-03-27 15:10:48 UTC (rev 59430)
@@ -1,15 +1,15 @@
/****************************************************************************
*
- * MODULE: r.stream.segment
- * AUTHOR(S): Jarek Jasiewicz jarekj amu.edu.pl
+ * MODULE: r.stream.segment
+ * AUTHOR(S): Jarek Jasiewicz jarekj amu.edu.pl
*
- * PURPOSE: Calculate geometrical attributes for segments of current order,
+ * PURPOSE: Calculate geometrical attributes for segments of current order,
* divide segments on near straight line portions and
- * and segment orientation and angles between streams and its
- * tributaries. For stream direction it use algorithm to divide
- * particular streams of the same order into near-straight line
- * portions.
+ * segment orientation and angles between streams and its
+ * tributaries. For stream direction it use algorithm to divide
+ * particular streams of the same order into near-straight line
+ * portions.
*
*
*
@@ -60,12 +60,12 @@
G_add_keyword(_("stream divide"));
in_stm_opt = G_define_standard_option(G_OPT_R_INPUT);
- in_stm_opt->key = "streams";
+ in_stm_opt->key = "stream_raster";
in_stm_opt->description = _("Name of input streams mask raster map");
in_dir_opt = G_define_standard_option(G_OPT_R_INPUT);
- in_dir_opt->key = "dirs";
- in_dir_opt->description = _("Name of input flow direction raster map");
+ in_dir_opt->key = "direction";
+ in_dir_opt->description = _("Name for input raster map with flow direction");
in_elev_opt = G_define_standard_option(G_OPT_R_ELEV);
@@ -221,11 +221,6 @@
}
-
-
-
-
-
for (i = 1; i < number_of_streams; ++i)
G_message("%d %d %d", stream_attributes[i].stream,
stream_attributes[i].next_stream,
@@ -250,9 +245,6 @@
}
-
-
-
/*
Modified: grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html
===================================================================
--- grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html 2014-03-27 15:10:37 UTC (rev 59429)
+++ grass-addons/grass7/raster/r.stream.segment/r.stream.segment.html 2014-03-27 15:10:48 UTC (rev 59430)
@@ -4,61 +4,67 @@
<dl>
<dt><b>-r</b></dt>
<dd>Directions and azimut output in radians. Default is degrees.</dd>
+
<dt><b>-m</b></dt>
<dd>Only for very large data sets. Use segment library to optimize memory
consumption during analysis</dd>
-<dt><b>stream</b></dt>
+
+<dt><b>stream_rast</b></dt>
<dd>Stream network: name of input stream map. Streams shall be ordered according
one of the r.stream.order ordering system as well as unordered (with original
stream identifiers) Because streams network produced by r.watershed and
-r.stream.extract may slightly differ in detail it is required to use both stream
+r.stream.extract may slightly differ in detail, it is required to use both stream
and direction map produced by the same module. Stream background shall have NULL
value or zero value. Background values of NULL are by default produced by
r.watershed and r.stream.extract. If not 0 or NULL use <a
href="r.mapcalc.html">r.mapcalc</a> to set background values to null.
</dd>
-<dt><b>dirs</b></dt>
+
+<dt><b>direction</b></dt>
<dd>Flow direction: name of input direction map produced by r.watershed or
r.stream.extract. If r.stream.extract output map is used, it only has non-NULL
values in places where streams occur. NULL (nodata) cells are ignored, zero and
negative values are valid direction data if they vary from -8 to 8 (CCW from
East in steps of 45 degrees). Direction map shall be of type CELL values. Region
resolution and map resolution must be the same.
-Also <em>stream</em> network map must have the same resolution. It is checked by
+Also <em>stream_rast</em> network map must have the same resolution. It is checked by
default. If resolutions differ the module informs about it and stops. Region
boundary and maps boundary may be differ but it may lead to unexpected
results.</dd>
+
<dt><b>elevation</b></dt>
<dd>Elevation: name of input elevation map. Map can be of type CELL, FCELL or
-DCELL. It is not restricted to resolution of region settings as streams and
-dirs.</dd>
+DCELL. It is not restricted to resolution of region settings as stream_rast and
+direction.</dd>
+
<dt><b>length</b></dt>
<dd>Integer values indicating the search length (in cells) to determine straight
line. The longest length parameter the module treats more tolerant local stream
-undulation and inequalities. Default value of 15 is suitable for 30 meters
-DEMS. More detail DEMS may requre longer length.</dd>
+undulation and inequalities. Default value of 15 is suitable for 30 meters
+DEMs. More detail DEMs may requre longer length.</dd>
<dt><b>skip</b></dt>
<dd>Integer values indicating the length (in cells) local short segment to skip
and join them to the longer neighbour. The shortest length parameter the more
short segments will be produced by the module due to undulation and
-inequalities. Default value of 5 is suitable for 30 meters DEMS. More details
+inequalities. Default value of 5 is suitable for 30 meters DEMS. More details
DEMS may require longer length.</dd>
-<dt><b>treshold</b></dt>
+<dt><b>threshold</b></dt>
<dd>real value indicates the internal angle between upstream and downstream
-direction to treat actual cell as lying on the straight line. greater value (up to
-180 degrees) produces more segments. Lesser values produced less segments.
-Values below 90 in most cases will not produce any additional segments to these
-resulting from ordering
-</dl>
+direction to treat actual cell as lying on the straight line. Greater values (up to
+180 degrees) produce more segments. Lower values produce less segments.
+Values below 90 in most cases will not produce any additional segments to those
+resulting from ordering.</dl>
+
<dl>
<h2>OUTPUTS</h2>
<p>The module produces two vector maps: one representing original segments
-(where segment is a streamline where its order remains unchanged) and second
+(where a segment is a streamline where its order remains unchanged) and the second
divided into near straight line sectors resulting form segmentation process.
-Most of segment and sectors attributes are the same as in r.stream.order vector
+Most of the segment and sectors attributes are the same as in r.stream.order vector
output.</p>
+
<dl>
<dt><b>segments</b></dt>
<dd>
@@ -141,13 +147,13 @@
algorithm is searching for those points where curves significantly change their
direction.
The definition of stream segments depends on the ordering method selected by the
-user, Strahler's, Horton's or Hack's main stream, or the network may remain
+user, Strahler's, Horton's or Hack's main stream, or the network may remain
unordered. All junctions of streams to streams of higher order are always split
points, but for ordered networks, streams of higher order may be divided into
sections which ignore junctions with streams of lower order. In unordered
networks all junctions are always split points.
In extended mode the module also calculates the direction of a stream to its
-higher order stream If the higher order stream begins at the junction with the
+higher order stream. If the higher order stream begins at the junction with the
current stream (Strahler's ordering only) or if the network is unordered, the
direction is calculated as the direction of the line between junction point and
downstream point (Howard 1971) within the user-defined global search distance.
@@ -160,20 +166,20 @@
<h2>NOTES</h2>
<p>
-Module can work only if direction map, stream map and region map has same
-settings. It is also required that stream map and direction map come from the
+The module can work only if direction map, stream_rast map and region have the same
+settings. It is also required that stream_rast map and direction map come from the
same source. For lots of reason this limitation probably cannot be omitted.
-this means if stream map comes from r.stream.extract also direction map from
-r.stream.extract must be used. If stream network was generated with MFD method
+This means that if stream_rast map comes from r.stream.extract, also direction map from
+r.stream.extract must be used. If stream_rast network was generated with MFD method,
also MFD direction map must be used.
<h2>EXAMPLE</h2>
<div class="code"><pre>
g.region -p -a rast=elevation align=elevation
-r.watershed elevation=elevation threshold=10000 drainage=dirs stream=streams
-r.stream.order streams=streams dirs=dirs strahler=riverorder_strahler
-r.stream.segment streams=riverorder_strahler dirs=dirs elevation=elevation segments=river_segment sectors=river_sector
+r.watershed elevation=elevation threshold=10000 drainage=direction stream=streams
+r.stream.order stream_vect=streams direction=direction strahler=riverorder_strahler
+r.stream.segment stream_rast=riverorder_strahler direction=direction elevation=elevation segments=river_segment sectors=river_sector
</pre></div>
<h2>SEE ALSO</h2>
More information about the grass-commit
mailing list