[GRASS-user] Multiple usage of r.water.outlet

Christian Schwartze Christian.Schwartze at uni-jena.de
Thu May 15 08:02:42 EDT 2008


Dear GRASS user,

the problem I have is using r.water.outlet for some scripting in Python. Below I
want to explain the proceeding in detail. It should be mentioned in advance that
the necessary drainage raster has nearly 10000 rows and columns, so it's not
really small...
I have a point shape file (or generally point coordinates, more than 100 pairs)
that presents the input for multiple calls of r.water.outlet. To produce a map
representing the corresponding watersheds of all these points I thought of the
three following approaches:

(A)  At certain intervals (of the r.water.outlet iteration) I sort the previous
calculated basins by area and use the resulting and ascending order as an input
for r.patch. So the basins can not hide each other.

(B) At certain intervals I execute r.cross for overlaying the previous basins.

(C) I use r.mapcalc in every iteration step with an expression like
"allbasins = allbasins +
if(isnull(allbasins),basin<x>,if(allbasins>=1&&basin<x>==1,<newBasinID>,allbasins))"
where allbasins is initially a "novalue" raster.


All methods above are working right, but have the same lack: the performance -
too slow!
Remember that the working raster has an extent of 10000x10000 pixel. The single
calculated basins and their extents compared to entire drainage raster are very
small (see the attachment). While the duration of r.water.outlet is barely
acceptable, the merging step (regardless of the technique in A, B or C) takes
too long.
What do you think about the three approaches for a script in Python and how can
i minimize the performance problem when bringing the basins together within a
large area? Many thanks for any advice!

Regards,
Christian.



----------------------------------------------------------------
This mail was sent through http://webmail.uni-jena.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wateroutlet.png
Type: image/png
Size: 19180 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080515/f6849974/wateroutlet-0001.png


More information about the grass-user mailing list