[GRASSLIST:6375] Re: r.terraflow and r.water.outlet

swlab swlab at cornell.edu
Fri Apr 8 12:20:47 EDT 2005

> No. I tried some time ago with no success. The flow directions do not
> seem to be what r.water.outlet expects.

I gonna simplify a bit, that should give you the gist of it nevertheless

r.terraflow uses by default a MFD algorithm (multiple flow path). In short, 
the outflow of one cell is distributed among ALL its downslope neighbors, 
according to the relative differences in elevation. The nb stored in the flow 
direction output of terraflow corresponds to the neighbors id, stored as an 
octet (so, between 0 and 255), clockwise from East (1 for East, 2 for SE, 4 
for S, 8 for SW...) : for example, if water flows to the North and the south 
simultaneously, the flow direction value is 68 (4 for S + 64 for N). NNE ? 
64+128, and so on...

r.watershed uses a SFD (single flow direction) algorithm, where water is 
routed to ONE downslope neighbor. The flow directions are coded as an integer 
between 1 and 8.

There should be a trick to get main flow directions (pseudoSF) from terraflow 
MFD: check the sources, direction.cc: there's a series of test to get the 
main direction from the 0-255 value (function findDominant). A simple script 
should do the work. I tried to write such a script smoe time ago, but don't 
ask me where it is, my box is a mess these days...

Pierre Gerard-Marchant
Soil & Water laboratory
Dept. of Biological & Environmental Engineering
75 Riley-Robb Hall
ITHACA, NY 14853 - USA
Tel. (607) 255.2463
"It's more fun to compute" ~ Kraftwerk

More information about the grass-user mailing list