1r.fill.dir(1) Grass User's Manual r.fill.dir(1)
2
3
4
6 r.fill.dir - Filters and generates a depressionless elevation map and
7 a flow direction map from a given elevation raster map.
8
10 raster, hydrology, sink, fill sinks, depressions
11
13 r.fill.dir
14 r.fill.dir --help
15 r.fill.dir [-f] input=name output=name direction=name [areas=name]
16 [format=string] [--overwrite] [--help] [--verbose] [--quiet]
17 [--ui]
18
19 Flags:
20 -f
21 Find unresolved areas only
22
23 --overwrite
24 Allow output files to overwrite existing files
25
26 --help
27 Print usage summary
28
29 --verbose
30 Verbose module output
31
32 --quiet
33 Quiet module output
34
35 --ui
36 Force launching GUI dialog
37
38 Parameters:
39 input=name [required]
40 Name of input elevation raster map
41
42 output=name [required]
43 Name for output depressionless elevation raster map
44
45 direction=name [required]
46 Name for output flow direction map for depressionless elevation
47 raster map
48
49 areas=name
50 Name for output raster map of problem areas
51
52 format=string
53 Aspect direction format
54 Options: agnps, answers, grass
55 Default: grass
56
58 r.fill.dir filters and generates a depressionless elevation map and a
59 flow direction map from a given raster elevation map. The method
60 adopted to filter the elevation map and rectify it is based on the
61 paper titled "Extracting topographic structure from digital elevation
62 model data for geographic information system analysis" by S.K. Jenson
63 and J.O. Domingue (1988).
64
65 The procedure takes an elevation layer as input and initially fills all
66 the depressions with one pass across the layer. Next, the flow direc‐
67 tion algorithm tries to find a unique direction for each cell. If the
68 watershed program detects areas with pothholes, it delineates this area
69 from the rest of the area and once again the depressions are filled
70 using the neighborhood technique used by the flow direction routine.
71 The final output will be a depressionless elevation layer and a unique
72 flow direction layer.
73
74 This (D8) flow algorithm performs as follows: At each raster cell the
75 code determines the slope to each of the 8 surrounding cells and
76 assigns the flow direction to the highest slope out of the cell. If
77 there is more than one equal, non-zero slope then the code picks one
78 direction based on preferences that are hard-coded into the program.
79 If the highest slope is flat and in more than one direction then the
80 code first tries to select an alternative based on flow directions in
81 the adjacent cells. r.fill.dir iterates that process, effectively prop‐
82 agating flow directions from areas where the directions are known into
83 the area where the flow direction cannot otherwise be resolved.
84
85 The format parameter is the type of format at which the user wishes to
86 create the flow direction map. The flow direction map can be encoded
87 in GRASS GIS aspect format, ANSWERS (Beasley et.al, 1982), or AGNPS
88 (Young et.al, 1985) format, so that it can be readily used as input to
89 other GRASS GIS modules or the aforementioned hydrological models. The
90 grass format gives the same category values as r.slope.aspect gives for
91 aspect, i.e. angles in degrees counter-clockwise from east in 45 degree
92 increments. The agnps format gives category values from 1-8, with 1
93 facing north and increasing values in the clockwise direction. The
94 answers format gives category values from 0-360 degrees, with 0 (repre‐
95 sented as 360) facing east and values increasing in the counter-clock‐
96 wise direction at 45 degree increments.
97
98 In case of local problems, those unfilled areas can be stored option‐
99 ally. Each unfilled area in this maps is numbered. The -f flag
100 instructs the program to fill single-cell pits but otherwise to just
101 find the undrained areas and exit. With the -f flag set the program
102 writes an elevation map with just single-cell pits filled, a direction
103 map with unresolved problems and a map of the undrained areas that were
104 found but not filled. This option was included because filling DEMs was
105 often not the best way to solve a drainage problem. These options let
106 the user get a partially-fixed elevation map, identify the remaining
107 problems and fix the problems appropriately.
108
109 In some cases it may be necessary to run r.fill.dir repeatedly (using
110 output from one run as input to the next run) before all of problem
111 areas are filled.
112
113 The resulting depressionless elevation raster map can further be pro‐
114 cessed to derive slopes and other attributes required by other hydro‐
115 logical models.
116
117 As any GRASS GIS module, r.fill.dir is sensitive to the computational
118 region settings. Thus the module can be used to generate a flow direc‐
119 tion map for any sub-area within the full map layer. Also, r.fill.dir
120 is sensitive to any raster MASK in effect.
121
123 · The r.fill.dir module can be used not only to fill depression,
124 but also to detect water bodies or potential water bodies based
125 on the nature of the terrain and the digital elevation model
126 used.
127
128 · Not all depressions are errors in digital elevation models. In
129 fact, many are wetlands and as Jenkins and McCauley (2006) note
130 careless use of depression filling may lead to unintended con‐
131 sequences such as loss of wetlands.
132
133 · Although many hydrological algorithms require depression fill‐
134 ing, advanced algorithms such as those implemented in r.water‐
135 shed and r.sim.water do not require depressionless digital ele‐
136 vation model to work.
137
138 · The flow direction map can be visualized with d.rast.arrow.
139
141 Generic example: create a depressionless (sinkless) elevation map
142 ansi.fill.elev and a flow direction map ansi.asp for the type "grass":
143 r.fill.dir input=ansi.elev output=ansi.fill.elev direction=ansi.asp
144
145 North Carolina sample dataset example: The LiDAR derived 1m elevation
146 map is sink-filled. The outcome are a depressionless elevation map, the
147 flow direction map and an error map.
148 # set computational region to elevation map
149 g.region raster=elev_lid792_1m -p
150 # generate depressionless DEM and related maps
151 r.fill.dir input=elev_lid792_1m output=elev_lid792_1m_filled \
152 direction=elev_lid792_1m_dir areas=elev_lid792_1m_error
153 # generate elevation map of pixelwise differences to see obtained terrain alterations
154 r.mapcalc "elev_lid792_1m_diff = elev_lid792_1m_filled - elev_lid792_1m"
155 r.colors elev_lid792_1m_diff color=differences
156 # assess univariate statistics of differences
157 r.univar -e elev_lid792_1m_diff
158 # vectorize filled areas (here all fills are of positive value, see r.univar output)
159 r.mapcalc "elev_lid792_1m_fill_area = if(elev_lid792_1m_diff > 0.0, 1, null() )"
160 r.to.vect input=elev_lid792_1m_fill_area output=elev_lid792_1m_fill_area type=area
161 # generate shaded terrain for better visibility of results
162 r.relief input=elev_lid792_1m_filled output=elev_lid792_1m_filled_shade
163 d.mon wx0
164 d.shade shade=elev_lid792_1m_filled_shade color=elev_lid792_1m_filled
165 d.vect elev_lid792_1m_fill_area type=boundary color=red
166 Figure: Sink-filled DEM (shown as shaded terrain) with areas of filling
167 shown as vector polygons
168
170 · Beasley, D.B. and L.F. Huggins. 1982. ANSWERS (areal nonpoint
171 source watershed environmental response simulation): User’s
172 manual. U.S. EPA-905/9-82-001, Chicago, IL, 54 p.
173
174 · Jenkins, D. G., and McCauley, L. A. 2006. GIS, SINKS, FILL,
175 and disappearing wetlands: unintended consequences in algorithm
176 development and use. In Proceedings of the 2006 ACM symposium
177 on applied computing (pp. 277-282).
178
179 · Jenson, S.K., and J.O. Domingue. 1988. Extracting topographic
180 structure from digital elevation model data for geographic
181 information system analysis. Photogram. Engr. and Remote Sens.
182 54: 1593-1600.
183
184 · Young, R.A., C.A. Onstad, D.D. Bosch and W.P. Anderson. 1985.
185 Agricultural nonpoint surface pollution models (AGNPS) I and II
186 model documentation. St. Paul: Minn. Pollution control Agency
187 and Washington D.C., USDA-Agricultural Research Service.
188
190 d.rast.arrow, d.shade, g.region, r.fillnulls, r.relief, r.slope.aspect
191
193 Fortran version: Raghavan Srinivasan, Agricultural Engineering Depart‐
194 ment, Purdue University
195 Rewrite to C with enhancements: Roger S. Miller
196
197 Last changed: $Date: 2017-11-25 23:35:40 +0100 (Sat, 25 Nov 2017) $
198
200 Available at: r.fill.dir source code (history)
201
202 Main index | Raster index | Topics index | Keywords index | Graphical
203 index | Full index
204
205 © 2003-2019 GRASS Development Team, GRASS GIS 7.4.4 Reference Manual
206
207
208
209GRASS 7.4.4 r.fill.dir(1)