.\" %W% %G%
.TH r.fill.dir   
.SH NAME
r.fill.dir \- Filters and generates a depressionless elevation map and a flow direction map from a given elevation layer 
.SH DESCRIPTION
.B r.fill.dir	
The command format is:

r.fill.dir input=elev_map elevation=corrected_elev_map direction=flow_direction_map type=agnps (answers or grass)

.nf
input=map		elevation map
elevation=map	corrected elevation map
direction=map	flow direction map
type=text		type of flow direction map to be created
.fi

.SH EXAMPLE
r.fill.dir input=ansi.elev elevation=ansi.fill.elev direction=ansi.asp type=grass

.RS
will create a depressionless elevation map ansi.fill.elev and a flow direction map ansi.asp for the type grass 
.RE
.SH ATTENTION
.I The type
is the type of format at which the user wishes to create the flow direction
map. The \fIagnps\fR format gives category values from 1-8, with 1 facing north
and increasing values in the
clockwise direction. The \fIanswers\fR format gives category values from 0-360 degrees,
with 0 (360) facing east and values increasing in the counter clockwise direction at 45 degree increments.
The \fIgrass\fR format gives the same category values as the \fIr.slope.aspect\fR program.
.sp
.br
.I The method 
adopted to filter the elevation map and rectify it is based on the paper 
titled "Software Tools to Extract Structure from Digital Elevation Data 
for Geographic Information System Analysis" by S.K. Jenson and J.O. Domingue 
(1988).
.sp
.br
The procedure takes an elevation layer as input and initially fills all the depressions
with one pass across the layer. Next the flow direction algorithm tries to find
a unique direction for each cell. If the watershed program
detects areas with pothholes, it delineates this area from the rest of the area and
once again the depressions are filled using the neighborhood technique used
by the flow direction routine. The final output will be a depressionless
elevation layer and a unique flow direction layer.
.sp
.br
The flow direction map can be encoded in either ANSWERS
(Beasley et.al, 1982) or AGNPS (Young et.al, 1985) form, so that
it can be readily used as input to these hydrologic models. The resulting
depressionless elevation layer can further be manipulated for deriving
slopes and other attributes required by the hydrologic models.

.SH NOTE
.I The r.fill.dir
program is sensitive to the \fBcurrent window setting\fR. Thus the
program can be used to generate a flow direction map for any sub-area within the
full map layer. Also, \fIr.fill.dir\fR is sensitive to
any \fImask\fR in effect.

.SH SEE ALSO
r.direct, r.slope.aspect
.sp
Jenson, S.K., and J.O. Domingue. 1988. Extracting topographic structure from
digital elevation model data for geographic information system analysis. Photogram. Engr. and Remote Sens. 54: 1593-1600.
.sp
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.
.sp
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
Service.

.SH "AUTHOR"
Raghavan Srinivasan, Agricultural Engineering Department, Purdue University
