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

Eric Hillmuth hillmuth at verizon.net
Fri Apr 8 12:40:16 EDT 2005


OK, that makes sense. If I use the -s flag to force r.terraflow to use 
SFD will my flow directions be 1-8 rather than 0-255?

swlab wrote:

>>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...
>
>
>  
>




More information about the grass-user mailing list