Forráskód Böngészése

v.generalize: add test for self-intersection, use Vect_line_intersection2()
(merge https://trac.osgeo.org/grass/changeset/62162 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@66887 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 éve
szülő
commit
6234432968
1 módosított fájl, 5 hozzáadás és 12 törlés
  1. 5 12
      vector/v.generalize/misc.c

+ 5 - 12
vector/v.generalize/misc.c

@@ -209,7 +209,7 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 
     /* 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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
     }
     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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 	 * 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",