[GRASS-SVN] r66887 - grass/branches/releasebranch_7_0/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 21 10:47:43 PST 2015


Author: martinl
Date: 2015-11-21 10:47:43 -0800 (Sat, 21 Nov 2015)
New Revision: 66887

Modified:
   grass/branches/releasebranch_7_0/vector/v.generalize/misc.c
Log:
v.generalize: add test for self-intersection, use Vect_line_intersection2()
(merge r62162 from trunk)


Modified: grass/branches/releasebranch_7_0/vector/v.generalize/misc.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.generalize/misc.c	2015-11-21 18:37:52 UTC (rev 66886)
+++ grass/branches/releasebranch_7_0/vector/v.generalize/misc.c	2015-11-21 18:47:43 UTC (rev 66887)
@@ -209,7 +209,7 @@
 
     /* Check the modified boundary for self-intersection */
     AXLines = BXLines = NULL;
-    Vect_line_intersection(Points, Points, &box, &box, &AXLines, &BXLines,
+    Vect_line_intersection2(Points, NULL, &box, &box, &AXLines, &BXLines,
 			   &naxlines, &nbxlines, 0);
     /* Free */
     if (naxlines > 0) {
@@ -219,15 +219,7 @@
     }
     if (AXLines)
 	G_free(AXLines);
-    if (nbxlines > 0) {
-	for (j = 0; j < nbxlines; j++) {
-	    Vect_destroy_line_struct(BXLines[j]);
-	}
-    }
-    if (BXLines)
-	G_free(BXLines);
-
-    if (naxlines > 0 || nbxlines > 0)
+    if (naxlines > 0)
 	return 0;
 
     /* Check intersection of the modified boundary with other boundaries */
@@ -247,8 +239,9 @@
 	 * intersections should be found if any */
 
 	AXLines = BXLines = NULL;
-	Vect_line_intersection(Points, BPoints, &box, &List->box[i], &AXLines, &BXLines,
-			       &naxlines, &nbxlines, 0);
+	Vect_line_intersection2(Points, BPoints, &box, &List->box[i],
+	                        &AXLines, &BXLines,
+			        &naxlines, &nbxlines, 0);
 
 	G_debug(4,
 		"bline = %d intersect = %d naxlines = %d nbxlines = %d",



More information about the grass-commit mailing list