[GRASS-dev] r.watershed and swap memory

Luca Casagrande luca.casagrande at gmail.com
Thu Mar 27 08:40:36 EDT 2008


I made some test using r.water.outlet with Spearfish location and
output coming from GRASS and from TerraSTREAM:

http://www.movedigital.com/go/doktoreas/114926/grass_terrastream.jpg

The drainage map created with TerraSTREAM has been reclassified using those 
rules:

0=-1
128=1
1=2
2=3
4=4
8=5
16=6
32=7
64=0

As you can notice, the result are quite different and the one from TS generate 
a really small area.

Any idea on that?

Thanks for your help
Luca

On Thursday 27 March 2008 01:31:07 Andrew Danner wrote:
> Luca,
>
>  The Terrastream direction coding for single flow direction is as
> follows
>
> 1 = Water flows east
> 2 = SE
> 4 = S
> 8 = SW
> 16 = W
> 32 = NW
> 64 = N
> 128 = NE
>
> Or pictorially
>
>  32  64 128
>  16   x  1
>   8   4  2
>
> In the MFD case, values do NOT represent aspects in the range 0 to 360,
> but instead indicate sums of the directions above. Thus if water flows
> N, S and SW, the value is 64+8+4 = 76.
>
> In both the SFD/MFD outputs, a value of 0 means this point is local
> minimum and there is no flow direction.
>
> r.water.outlet reports:
> drainage=name
>         Input map: drainage direction. Indicates the "aspect" for each
>         cell. Multiplying positive values by 45 will give the direction
>         in degrees that the surface runoff will travel from that cell.
>         The value -1 indicates that the cell is a depression area. Other
>         negative values indicate that surface runoff is leaving the
>         boundaries of the current geographic region. The absolute value
>         of these negative cells indicates the direction of flow. This
>         map is generated from r.watershed
>
> I don't know if the direction it refers to is measured from North or
> East or if it moves clockwise or counterclockwise.
>
> r.slope.aspect measures ccw from east, TerraStream and TerraFlow are
> measuring clockwise from East, and standard compass direction is
> measured clockwise from North.
>
> If someone is more familiar with the r.water.outlet drainage directions,
> it should be relatively easy to map the values 1,2,4,8,16,32,64 and 128
> to 1 through 7.  log_2(tflow_dir)+1 will map terrastream flow directions
> onto the range 1-7 (handling 0 is special case).
>
> Is there any consistent way of encoding flow direction?  TerraStream and
> TerraFlow I believe used an encoding from Jenson and Domingue, though in
> looking up their reference they started with 1 in the NE and moved
> clockwise. Perhaps ESRI products used 1=E. It seems that aspect should
> be measured clockwise in degrees from north geographically, but it makes
> more sense to measure ccw from east trigonometrically.
>
> TerraStream could easily rotate or reverse the values 1-255 if there is
> a standard out there to follow.
>
>
> -Andy



More information about the grass-dev mailing list