r.drain

Jim Westervelt westerve at marla.urban.uiuc.edu
Tue May 19 16:05:32 EDT 1992


# We would like to use r.drain to find the flow paths FROM
# a point on a stream up the slope to the watershed divide.
# 
# We have tried several unsuccesful methods, inverting the 
# elevation, slope and accumulation maps (accumulation map from
# watershed).

How does r.drain fail?    Two ways that I can think of:

1) The drain path does not continue to the expected outlet point.  This
   can be caused by lakes, depressions, or "pits".  The drain process
   in r.drain follows the greatest downward gradient.  If all surrounding
   cells are higher the drain process stops.     This situation happens
   often in the creation of DEMs.  A narrow drain point (relative to the
   cell resolution) can be completely lost, creating an uphill lake.
   Solution: "fill" the lakes.  Does someone have an imaginative way to
   accomplish this?  I have done this with a recursive r.mapcalc script 
   which "simulates" the drainage of water from a "storm event" over the
   DEM.  I was surprised to see how many "lakes" existed in the DEM.
   The r.mapcalc script is in an as yet unpublished document on r.mapcalc
   which is probably available through the GRASS Info Center (1-800-USA-CERL).

2) A drainage does occur, but the path turns into spaghetti here and there.
   This is an artifact of the mathematics tracing flows through a cell that
   contains two or more drain directions with equivalent slopes.



More information about the grass-dev mailing list