4
<em>r.fill.dir</em> filters and generates a depressionless
5
elevation map and a flow direction map from a given raster elevation map.
9
The <b>type</b> parameter is the type of format at which the user wishes to create
10
the flow direction map. The <i>agnps</i> format gives category values from
11
1-8, with 1 facing north and increasing values in the clockwise direction.
12
The <i>answers</i> format gives category values from 0-360 degrees, with 0
13
(360) facing east and values increasing in the counter clockwise direction
14
at 45 degree increments. The <i>grass</i> format gives the same category
15
values as the <em><a href="r.slope.aspect.html">r.slope.aspect</a></em>
18
The method adopted to filter the elevation map and rectify it is
19
based on the paper titled "Software Tools to Extract Structure from Digital
20
Elevation Data for Geographic Information System Analysis" by S.K. Jenson
21
and J.O. Domingue (1988).
24
The procedure takes an elevation layer as input and initially fills all the
25
depressions with one pass across the layer. Next, the flow direction
26
algorithm tries to find a unique direction for each cell. If the watershed
27
program detects areas with pothholes, it delineates this area from the rest
28
of the area and once again the depressions are filled using the neighborhood
29
technique used by the flow direction routine. The final output will be a
30
depressionless elevation layer and a unique flow direction layer.
33
This (D8) flow algorithm performs as follows: At each raster cell the code
34
determines the slope to each of the 8 surrounding cells and assigns the flow
35
direction to the highest slope out of the cell. If there is more than one
36
equal, non-zero slope then the code picks one direction based on preferences
37
that are hard-coded into the program. If the highest slope is flat and in
38
more than one direction then the code first tries to select an alternative
39
based on flow directions in the adjacent cells. <em>r.fill.dir</em> iteratates that process,
40
effectively propagating flow directions from areas where the directions are
41
known into the area where the flow direction can't otherwise be resolved.
44
The flow direction map can be encoded in either ANSWERS (Beasley et.al,
45
1982) or AGNPS (Young et.al, 1985) form, so that it can be readily used as
46
input to these hydrologic models. The resulting depressionless elevation
47
layer can further be manipulated for deriving slopes and other attributes
48
required by the hydrologic models.
51
In case of local problems, those unfilled areas can be stored optionally.
52
Each unfilled area in this maps is numbered. The <b>-f</b> flag
53
instructs the program to fill single-cell pits but otherwise to just find
54
the undrained areas and exit. With the <b>-f</b> flag set the program
55
writes an elevation map with just single-cell pits filled, a direction map
56
with unresolved problems and a map of the undrained areas that were found
57
but not filled. This option was included because filling DEMs was often not
58
the best way to solve a drainage problem. These options let the user get a
59
partially-fixed elevation map, identify the remaining problems and fix the
60
problems appropriately.
63
<em>r.fill.dir</em> is sensitive to the current window setting. Thus
64
the program can be used to generate a flow direction map for any
65
sub-area within the full map layer. Also, <em>r.fill.dir</em> is
66
sensitive to any <em>mask</em> in effect.
69
In some cases it may be necessary to run r.fill.dir repeatedly (using output
70
from one run as input to the next run) before all of problem areas are
75
<div class="code"><pre>
76
r.fill.dir input=ansi.elev elevation=ansi.fill.elev direction=ansi.asp
80
will create a depressionless (sinkless) elevation map ansi.fill.elev and a flow
81
direction map ansi.asp for the type "grass".
86
<a href="r.fillnulls.html">r.fillnulls</a>,
87
<a href="r.slope.aspect.html">r.slope.aspect</a></em>
90
Beasley, D.B. and L.F. Huggins. 1982. ANSWERS (areal nonpoint source watershed environmental response simulation): User's manual. U.S. EPA-905/9-82-001, Chicago, IL, 54 p.
92
Jenson, S.K., and J.O. Domingue. 1988. Extracting topographic structure from
93
digital elevation model data for geographic information system analysis. Photogram. Engr. and Remote Sens. 54: 1593-1600.
95
Young, R.A., C.A. Onstad, D.D. Bosch and W.P. Anderson. 1985. Agricultural nonpoint surface pollution models (AGNPS) I and II model documentation. St. Paul: Minn. Pollution control Agency and Washington D.C., USDA-Agricultural Research
101
Raghavan Srinivasan, Agricultural Engineering Department, Purdue
103
Rewrite to C with enhancements:
106
<p><i>Last changed: $Date: 2008-05-15 20:59:22 +0200 (Thu, 15 May 2008) $</i>