r.stream.extract.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <h2>DESCRIPTION</h2>
  2. <em>r.stream.extract</em> extracts streams in both raster and vector
  3. format from a required input <b>elevation</b> map and optional input
  4. <b>accumulation</b> map.
  5. <h2>NOTES</h2>
  6. <p>
  7. NULL (nodata) cells in the input <b>elevation</b> map are ignored,
  8. zero and negative values are valid elevation data. Gaps in the
  9. elevation map that are located within the area of interest must be
  10. filled beforehand, e.g. with
  11. <em><a href="r.fillnulls.html">r.fillnulls</a></em>, to avoid distortions.
  12. <p>
  13. All non-NULL and non-zero cells of <b>depression</b> map will be
  14. regarded as real depressions. Streams will not be routed out of
  15. depressions. If an area is marked as depression but the elevation
  16. model has no depression at this location, streams will not stop
  17. there. If a flow accumulation map and a map with real depressions are
  18. provided, the flow accumulation map must match the depression map such
  19. that flow is not distributed out of the indicated depressions. It is
  20. recommended to use internally computed flow accumulation if a
  21. depression map is provided.
  22. <p>
  23. Option <b>threshold</b> defines the minimum (optionally modified) flow
  24. accumulation value that will initiate a new stream. If Montgomery's
  25. method for channel initiation is used, the cell value of the
  26. accumulation input map is multiplied by <tt>(tan(local
  27. slope))<sup>mexp</sup></tt> and then compared
  28. to <b>threshold</b>. If <b>mexp</b> is given than the method of
  29. Montgomery and Foufoula-Georgiou (1993) to initiate a stream with this
  30. value. The cell value of the accumulation input map is multiplied
  31. by <tt>(tan(local slope))<sup>mexp</sup></tt> and then compared
  32. to <b>threshold</b>. If threshold is reached or exceeded, a new stream
  33. is initiated. The default value 0 disables Montgomery. Montgomery and
  34. Foufoula-Georgiou (1993) generally recommend to use 2.0 as
  35. exponent. <b>mexp</b> values closer to 0 will produce streams more
  36. similar to streams extracted with Montgomery disabled.
  37. Larger <b>mexp</b> values decrease the number of streams in flat areas
  38. and increase the number of streams in steep areas. If <b>weight</b> is
  39. given, the weight is applied first.
  40. <p>
  41. Option <b>d8cut</b> defines minimum amount of overland flow
  42. (accumulation) when SFD (D8) will be used instead of MFD (FD8) to
  43. calculate flow accumulation. Only applies if no accumulation map is
  44. provided. Setting to 0 disables MFD completely.
  45. <p>
  46. Option <b>stream_length</b> defines minimum stream length in number of
  47. cells for first-order (head/spring) stream segments. All first-order
  48. stream segments shorter than <b>stream_length</b> will be deleted.
  49. <p>
  50. Output <b>direction</b> raster map contains flow direction for all
  51. non-NULL cells in input elevation. Flow direction is of D8 type with a
  52. range of 1 to 8. Multiplying values with 45 gives degrees CCW from
  53. East. Flow direction was adjusted during thinning, taking shortcuts
  54. and skipping cells that were eliminated by the thinning procedure.
  55. <h3>Stream extraction</h3>
  56. If no <b>accumulation</b> input map is provided, flow accumulation is
  57. determined with a hydrological analysis similar to
  58. <em><a href="r.watershed.html">r.watershed</a></em>. The algorithm is
  59. MFD (FD8) after Holmgren 1994, as for
  60. <em><a href="r.watershed.html">r.watershed</a></em>. The <b>threshold</b>
  61. option determines the number of streams and detail of stream networks.
  62. Whenever flow accumulation reaches <b>threshold</b>, a new stream is
  63. started and traced downstream to its outlet point. As for
  64. <em><a href="r.watershed.html">r.watershed</a></em>, flow accumulation is
  65. calculated as the number of cells draining through a cell.
  66. <p>
  67. If <b>accumulation</b> is given than the accumulation values of the
  68. provided <b>accumulation</b> map are used and not calculated from the
  69. input <b>elevation</b> map. In this case the <b>elevation</b> map must
  70. be exactly the same map used to calculate
  71. <b>accumulation</b>. If <b>accumulation</b> was calculated with
  72. <em><a href="r.terraflow.html">r.terraflow</a></em>, the filled
  73. elevation output
  74. of <em><a href="r.terraflow.html">r.terraflow</a></em> must be
  75. used. Further on, the current region should be aligned to
  76. the <b>accumulation</b> map. Flow direction is first calculated
  77. from <b>elevation</b> and then adjusted to
  78. <b>accumulation</b>. It is not necessary to provide <b>accumulation</b>
  79. as the number of cells, it can also be the optionally adjusted or
  80. weighed total contributing area in square meters or any other unit.
  81. When an original flow accumulation map is adjusted or weighed, the
  82. adjustment or weighing should not convert valid accumulation values to
  83. NULL (nodata) values.
  84. <p>
  85. In case of getting the error message
  86. <tt>ERROR: Accumulation raster map is NULL but elevation map is not NULL</tt>
  87. the computational region must be carefully adjusted to exclude NULL pixels
  88. in the accumulation raster map prior to stream extraction.
  89. <h3>Weighed flow accumulation</h3>
  90. Flow accumulation can be calculated first, e.g. with
  91. <em><a href="r.watershed.html">r.watershed</a></em>, and then modified before
  92. using it as input for <em>r.stream.extract</em>. In its general form, a
  93. weighed accumulation map is generated by first creating a weighing map
  94. and then multiplying the accumulation map with the weighing map using
  95. <em><a href="r.mapcalc.html">r.mapcalc</a></em>. It is highly recommended to
  96. evaluate the weighed flow accumulation map first, before using it as
  97. input for <em>r.stream.extract</em>.
  98. <p>
  99. This allows e.g. to decrease the number of streams in dry areas and
  100. increase the number of streams in wet areas by setting <b>weight</b>
  101. to smaller than 1 in dry areas and larger than 1 in wet areas.
  102. <p>
  103. Another possibility is to restrict channel initiation to valleys
  104. determined from terrain morphology. Valleys can be determined with
  105. <em><a href="r.param.scale.html">r.param.scale</a></em> <tt>method=crosc</tt>
  106. (cross-sectional or tangential curvature). Curvature values &lt; 0
  107. indicate concave features, i.e. valleys. The size of the processing
  108. window determines whether narrow or broad valleys will be identified
  109. (See example below).
  110. <h3>Defining a region of interest</h3>
  111. The stream extraction procedure can be restricted to a certain region of
  112. interest, e.g. a subbasin, by setting the computational region with
  113. <em><a href="g.region.html">g.region</a></em> and/or creating a MASK. Such region of interest should
  114. be a complete catchment area, complete in the sense that the complete
  115. area upstream of an outlet point is included and buffered with at least
  116. one cell.
  117. <h3>Stream output</h3>
  118. The output raster and vector contains stream segments with unique
  119. IDs. Note that these IDs are different from the IDs assigned
  120. by <em><a href="r.watershed.html">r.watershed</a></em>. The vector
  121. output also contains points at the location of the start of a stream
  122. segment, at confluences and at stream network outlet locations.
  123. <p>
  124. Output <b>stream_raster</b> raster map stores extracted streams. Cell
  125. values encode a unique ID for each stream segment.
  126. <p>
  127. Output <b>stream_vector</b> vector map stores extracted stream segments
  128. and points. Points are written at the start location of each stream
  129. segment and at the outlet of a stream network. In layer 1, categories
  130. are unique IDs, identical to the cell value of the raster output. The
  131. attribute table for layer 1 holds information about the type of stream
  132. segment: start segment, or intermediate segment with
  133. tributaries. Columns are <tt>cat int, stream_type varchar(), type_code
  134. int</tt>. The encoding for type_code is 0 = start, 1 =
  135. intermediate. In layer 2, categories are identical to type_code in
  136. layer 1 with additional category 2 = outlet for outlet points. Points
  137. with category 1 = intermediate in layer 2 are at the location of
  138. confluences.
  139. <h2>EXAMPLE</h2>
  140. This example is based on the elevation map &quot;elev_ned_30m&quot; in the
  141. North Carolina sample dataset and uses valleys determined with
  142. <em><a href="r.param.scale.html">r.param.scale</a></em> to weigh an accumulation
  143. map produced with <em><a href="r.watershed.html">r.watershed</a></em>.
  144. <div class="code"><pre>
  145. # set region
  146. g.region -p raster=elev_ned_30m@PERMANENT
  147. # calculate flow accumulation
  148. r.watershed ele=elev_ned_30m@PERMANENT acc=elevation.10m.acc
  149. # curvature to get narrow valleys
  150. r.param.scale input=elev_ned_30m@PERMANENT output=tangential_curv_5 size=5 method=crosc
  151. # curvature to get a bit broader valleys
  152. r.param.scale input=elev_ned_30m@PERMANENT output=tangential_curv_7 size=7 method=crosc
  153. # curvature to get broad valleys
  154. r.param.scale input=elev_ned_30m@PERMANENT output=tangential_curv_11 size=11 method=crosc
  155. # create weight map
  156. r.mapcalc "weight = if(tangential_curv_5 &lt; 0, -100 * tangential_curv_5, \
  157. if(tangential_curv_7 &lt; 0, -100 * tangential_curv_7, \
  158. if(tangential_curv_11 &lt; 0, -100 * tangential_curv_11, 0.000001)))"
  159. # weigh accumulation map
  160. r.mapcalc expr="elev_ned_30m.acc.weighed = elev_ned_30m.acc * weight"
  161. # copy color table from original accumulation map
  162. r.colors map=elev_ned_30m.acc.weighed raster=elev_ned_30m.acc
  163. </pre></div>
  164. <p>
  165. <a href="r_stream_extract_weights_zoom.png">
  166. <img src="r_stream_extract_weights_zoom.png" width="400"></a><br>
  167. Weight map (spatial subset with lake in the southern half)
  168. <p>
  169. <a href="r_stream_extract_accum_orig_zoom.png">
  170. <img src="r_stream_extract_accum_orig_zoom.png" width="400"></a><br>
  171. Original flow accumulation map (spatial subset with lake in the southern half)
  172. <p>
  173. <a href="r_stream_extract_accum_weighted_zoom.png">
  174. <img src="r_stream_extract_accum_weighted_zoom.png" width="400"></a><br>
  175. Weighed flow accumulation map (spatial subset with lake in the southern half)
  176. <p>
  177. Display both the original and the weighed accumulation map.
  178. Compare them and proceed if the weighed accumulation map makes sense.
  179. <div class="code"><pre>
  180. # extract streams using the original accumulation map
  181. r.stream.extract elevation=elev_ned_30m@PERMANENT \
  182. accumulation=elev_ned_30m.acc \
  183. threshold=1000 \
  184. stream_rast=elev_ned_30m.streams.noweight
  185. # extract streams from weighed map
  186. r.stream.extract elevation=elev_ned_30m@PERMANENT \
  187. accumulation=elev_ned_30m.acc.weighed \
  188. threshold=1000 \
  189. stream_rast=elev_ned_30m.streams
  190. </pre></div>
  191. <p>
  192. Now display both stream maps and decide which one is more realistic.
  193. <!--
  194. d.shade color=elev_ned_30m_streams_noweight shade=elevation_shade brighten=20
  195. -->
  196. <p>
  197. <a href="r_stream_extract_streams_noweight.png">
  198. <img src="r_stream_extract_streams_noweight.png" width="400"></a><br>
  199. Extracted streams from original flow accumulation map
  200. <p>
  201. <a href="r_stream_extract_streams_weighed.png">
  202. <img src="r_stream_extract_streams_weighed.png" width="400"></a><br>
  203. Extracted streams from weighed flow accumulation map
  204. <h2>REFERENCES</h2>
  205. <ul>
  206. <li>Ehlschlaeger, C. (1989). <i>Using the A<sup>T</sup> Search
  207. Algorithm to Develop Hydrologic Models from Digital Elevation
  208. Data</i>,
  209. <b>Proceedings of International Geographic Information Systems (IGIS)
  210. Symposium '89</b>, pp 275-281 (Baltimore, MD, 18-19 March
  211. 1989). URL: <a href="http://faculty.wiu.edu/CR-Ehlschlaeger2/older/IGIS/paper.html">
  212. http://faculty.wiu.edu/CR-Ehlschlaeger2/older/IGIS/paper.html</a></li>
  213. <li>Holmgren, P. (1994). <i>Multiple flow direction algorithms for
  214. runoff modelling in grid based elevation models: An empirical
  215. evaluation.</i>
  216. <b>Hydrological Processes</b> Vol 8(4), pp 327-334. DOI: <a href="http://dx.doi.org/10.1002/hyp.3360080405">10.1002/hyp.3360080405</a></li>
  217. <li>Montgomery, D.R., Foufoula-Georgiou, E. (1993). <i>Channel network source
  218. representation using digital elevation models.</i>
  219. <b>Water Resources Research</b> Vol 29(12), pp 3925-3934.</li>
  220. </ul>
  221. <h2>SEE ALSO</h2>
  222. <em>
  223. <a href="r.mapcalc.html">r.mapcalc</a>,
  224. <a href="r.param.scale.html">r.param.scale</a>,
  225. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.channel.html">r.stream.channel</a> (Addon),
  226. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.distance.html">r.stream.distance</a> (Addon),
  227. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.order.html">r.stream.order</a> (Addon),
  228. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.segment.html">r.stream.segment</a> (Addon),
  229. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.slope.html">r.stream.slope</a> (Addon),
  230. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.snap.html">r.stream.snap</a> (Addon),
  231. <a href="https://grass.osgeo.org/grass7/manuals/addons/r.stream.stats.html">r.stream.stats</a> (Addon),
  232. <a href="r.terraflow.html">r.terraflow</a>,
  233. <a href="r.thin.html">r.thin</a>,
  234. <a href="r.to.vect.html">r.to.vect</a>,
  235. <a href="r.watershed.html">r.watershed</a>
  236. </em>
  237. <p>
  238. See
  239. also <a href="http://grasswiki.osgeo.org/wiki/R.stream.*_modules">r.streams.*
  240. modules</a> wiki page.
  241. <h2>AUTHOR</h2>
  242. Markus Metz
  243. <p>
  244. <i>Last changed: $Date$</i>