R.stream.* modules: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 55: Line 55:
<source lang="bash">r.stream.basins dir=dirs stream=streams basins=bas_basins_elem</source>
<source lang="bash">r.stream.basins dir=dirs stream=streams basins=bas_basins_elem</source>


[[File:bas_elem.png||350px|thumb|center|Digital elevation model with streams]]
[[File:bas_elem.png||350px|thumb|center|Elementary basins]]


To delineate all basins definied by outlets, ignoring subbasins use similar code but with - l flag. That flag ignores all nodes and uses only real outlets (in most cases that on image border). That option is very useful to determine major and minor basins in area.
To delineate all basins definied by outlets, ignoring subbasins use similar code but with - l flag. That flag ignores all nodes and uses only real outlets (in most cases that on image border). That option is very useful to determine major and minor basins in area.
Line 62: Line 62:




[[File:bas_basin_last.png|350px|thumb|center|Digital elevation model with streams]]
[[File:bas_basin_last.png|350px|thumb|center|Main basins]]


To delinaeate only one or more particular basin it require to reclass stream basin to theplaned set. The fastest method is r.reclass but also r.mapcalc may repcalce r.reclass. The output is the last (downstream) cell of given stream:
To delinaeate only one or more particular basin it require to reclass stream basin to theplaned set. The fastest method is r.reclass but also r.mapcalc may repcalce r.reclass. The output is the last (downstream) cell of given stream:
Line 74: Line 74:
</pre>
</pre>


[[File:basin_1.png|350px|thumb|center|Digital elevation model with streams]]
[[File:basin_1.png|350px|thumb|center|One basin]]


It is also possible to use more than one stream as an output. If some stream will be tributurary of others it will produce subbasins in main basins. It can be eliminated with -l flag only if streams are in sequence.
It is also possible to use more than one stream as an output. If some stream will be tributurary of others it will produce subbasins in main basins. It can be eliminated with -l flag only if streams are in sequence.
Line 87: Line 87:
r.stream.basins dir=dirs stream=streams basins=bas_basin_3
r.stream.basins dir=dirs stream=streams basins=bas_basin_3
</pre>
</pre>
[[File:basin_3.png|350px|thumb|center|Digital elevation model with streams]]
[[File:basin_3.png|350px|thumb|center|Three basins]]
To delineate only one or more particular basin it require to reclass stream basin to the planed set. The fastest method is r.reclass but also r.mapcalc may replicate r.reclass. The output is the last (downstream) cell of given stream
 
<pre>
echo '42=42
* = NULL' > tmp1
r.reclass input=streams output=sel_streams_1 <tmp1
r.stream.basins dir=dirs@horton stream=streams basins=bas_basin_1
</pre>
[[File:Bas_42_elems.png|350px|thumb|center|main basin and subbasins with streams]]

Revision as of 13:48, 5 October 2009

Modules r.stream.order r.stream.basins, r.stream.distance and r.stream.stats are prepared to perform Hortonian analysis in GRASS GIS. Modules can work with outputs data of r.watershed and r.stream.extract being preparing by Markus Metz.

The tutorial/presentation was prepared with North Carolina Dataset.

http://grass.osgeo.org/download/data.php

As a base map elev_ned_30_m was used. Regions setings for analysis:

projection: 99 (Lambert Conformal Conic)
zone:       0
datum:      nad83
ellipsoid:  a=6378137 es=0.006694380022900787
north:      228500
south:      215000
west:       630000
east:       645000
nsres:      30
ewres:      30
rows:       450
cols:       500
cells:      225000
Digital elevation model with streams

Because r.stream.extract is still in progress analysis will be based on r.watershed results. Stream network has been obtained with r.watershed in MFD mode:

r.watershed -f elevation=elev threshold=700 accumulation=accum drainage=dirs stream=streams convergence=5

Be sure you set the region for analysis before run it.

g.region rast=elev_ned_30_m

For future analysis following map produced by r.watershed are requied: streams with streams network, dirs with flow direction and accum with flow accumulation.


r.stream.order

Module r.stream.strahler may order stream network according four most popular ordering systems. Module can create both all four at once or every order separete

r.stream.order stream=streams dir=dirs accum=accum strahler=strahler shreve=shreeve horton=horton hack=hack

To obtain Scheidegger's stream order is just enough multiply Shreve stream magnitude x2.

r.stream.basins

Module r.stream.basins is prepared to delineate basins and subasins according user rules. I covers (in very small part) funcionalty of r.water.outlet and r.watershed but addationaly has much more posibilities which are presented in this section of tutorial. Module is prepared to delineate number of basins in one step. It requires only two maps direciton and streams. In stream map we can store all information required to proper delineation.

To delinaate all basins with categories of streams simply use:

r.stream.basins dir=dirs stream=streams basins=bas_basins_elem
Elementary basins

To delineate all basins definied by outlets, ignoring subbasins use similar code but with - l flag. That flag ignores all nodes and uses only real outlets (in most cases that on image border). That option is very useful to determine major and minor basins in area.

r.stream.basins -l dir=dirs stream=streams basins=bas_basins_last


Main basins

To delinaeate only one or more particular basin it require to reclass stream basin to theplaned set. The fastest method is r.reclass but also r.mapcalc may repcalce r.reclass. The output is the last (downstream) cell of given stream:

echo '42=42
* = NULL' > tmp1

r.reclass input=streams output=sel_streams_1 <tmp1
r.stream.basins dir=dirs stream=streams basins=bas_basin_1 
One basin

It is also possible to use more than one stream as an output. If some stream will be tributurary of others it will produce subbasins in main basins. It can be eliminated with -l flag only if streams are in sequence.

echo '42 = 42
252 = 252
188 = 188
* = NULL' >tmp

r.reclass input=streams output=sel_streams_1 <tmp1
r.stream.basins dir=dirs stream=streams basins=bas_basin_3
Three basins

To delineate only one or more particular basin it require to reclass stream basin to the planed set. The fastest method is r.reclass but also r.mapcalc may replicate r.reclass. The output is the last (downstream) cell of given stream

echo '42=42
* = NULL' > tmp1
r.reclass input=streams output=sel_streams_1 <tmp1
r.stream.basins dir=dirs@horton stream=streams basins=bas_basin_1 
main basin and subbasins with streams