[GRASS-SVN] r53691 - grass/trunk/vector/v.overlay
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 5 05:40:52 PST 2012
Author: mmetz
Date: 2012-11-05 05:40:51 -0800 (Mon, 05 Nov 2012)
New Revision: 53691
Modified:
grass/trunk/vector/v.overlay/area_area.c
Log:
v.overlay: area-area needs more cleaning
Modified: grass/trunk/vector/v.overlay/area_area.c
===================================================================
--- grass/trunk/vector/v.overlay/area_area.c 2012-11-05 13:07:09 UTC (rev 53690)
+++ grass/trunk/vector/v.overlay/area_area.c 2012-11-05 13:40:51 UTC (rev 53691)
@@ -51,6 +51,28 @@
/* ?: May be result of Vect_break_lines() + Vect_remove_duplicates() any dangle or bridge?
* In that case, calls to Vect_remove_dangles() and Vect_remove_bridges() would be also necessary */
+ Vect_build_partial(Out, GV_BUILD_AREAS);
+ nlines = Vect_get_num_lines(Out);
+ ret = 0;
+ for (line = 1; line <= nlines; line++) {
+ if (!Vect_line_alive(Out, line))
+ continue;
+ if (Vect_get_line_type(Out, line) == GV_BOUNDARY) {
+ int left, rite;
+
+ Vect_get_line_areas(Out, line, &left, &rite);
+
+ if (left == 0 || rite == 0) {
+ ret = 1;
+ break;
+ }
+ }
+ }
+ if (ret) {
+ Vect_remove_dangles(Out, GV_BOUNDARY, -1, NULL);
+ Vect_remove_bridges(Out, NULL, NULL, NULL);
+ }
+
/* Attach islands */
G_message(_("Attaching islands..."));
Vect_build_partial(Out, GV_BUILD_ATTACH_ISLES);
More information about the grass-commit
mailing list