[GRASS-user] Overlapping vector areas

Hi

I am trying the generate watersheds for several outlets by looping
over r.water.outlet in a python script (attached). The basin procedure
is that for each outlet point (read using v.info -t), my script runs
r.water.outlet, r.to.vect and v.patch, to combine the watersheds into
a simgle vector map. I am connecting the watersheds to the outlet
points by setting the category value in the output from r.to.vect,
i.e. before patching. The trouble is that some of the watersheds
overlap, e.g. where an outlet lies inside another watershed. v.patch
doesn't seem to handle this too well, and the result is that I have a
vector map with a few areas, a few boundaries, a few centroids and a
lot of errors.

Is there a better way of approaching this? And how do I allow overlapping areas?

Regards
David

(attachments)

r.water.outlet.points.py (3.07 KB)

No, since GRASS enforces topology, there’s no such thing as overlapping polygons. If you run r.water.outlet twice in the same stream network, you will get one basin that’s a sub-catchment of a larger basin. If you try to patch these two vector maps, assuming the patch succeeds, and there are no topology errors, you’ll get the smaller basin as one polygon, and the larger basin with the smaller one “cut out” as the second polygon.

I’ve encountered a similar problem to yours: many small overlaps or gaps along the boundary between two adjacent basins created by two runs of r.water.outlet.
I don’t know of any easy solution, other than using the options included with “v.clean” to remove small areas and snap boundaries that are within a given threshold. THen after v.clean, there will often still be a few errors that need to be ironed out manually with v.digit.

HTH,

···
-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)

On Thu, Jul 29, 2010 at 8:28 PM, Micha Silver <micha@arava.co.il> wrote:

On 07/29/2010 06:38 PM, David Townshend wrote:

Hi

I am trying the generate watersheds for several outlets by looping
over r.water.outlet in a python script (attached). The basin procedure
is that for each outlet point (read using v.info -t), my script runs
r.water.outlet, r.to.vect and v.patch, to combine the watersheds into
a simgle vector map. I am connecting the watersheds to the outlet
points by setting the category value in the output from r.to.vect,
i.e. before patching. The trouble is that some of the watersheds
overlap, e.g. where an outlet lies inside another watershed. v.patch
doesn't seem to handle this too well, and the result is that I have a
vector map with a few areas, a few boundaries, a few centroids and a
lot of errors.

Is there a better way of approaching this? And how do I allow overlapping
areas?

No, since GRASS enforces topology, there's no such thing as overlapping
polygons. If you run r.water.outlet twice in the same stream network, you
will get one basin that's a sub-catchment of a larger basin. If you try to
patch these two vector maps, assuming the patch succeeds, and there are no
topology errors, you'll get the smaller basin as one polygon, and the larger
basin with the smaller one "cut out" as the second polygon.

The output of this is going to be written to a shapefile and processed
further in arcgis (by someone else), so would they then have to
manually combine the polygons to create the larger basins? A smaller
"cut-out" basin is of no use for my purposes, so they'll need to be
combined somehow. I'd thought about using a non-topological vector
map, but it seems that I can't do anything further with it without
building a topology.

I've encountered a similar problem to yours: many small overlaps or gaps
along the boundary between two adjacent basins created by two runs of
r.water.outlet.
I don't know of any easy solution, other than using the options included
with "v.clean" to remove small areas and snap boundaries that are within a
given threshold. THen after v.clean, there will often still be a few errors
that need to be ironed out manually with v.digit.

Small errors like this are not really a problem for me since I'm
working with such coarse data and rough hydrology that slight
inaccuracies in the basin delineation will have no effect on the final
output.