Przeglądaj źródła

v.net: fix https://trac.osgeo.org/grass/ticket/2473

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62684 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 10 lat temu
rodzic
commit
d26c873931
1 zmienionych plików z 11 dodań i 4 usunięć
  1. 11 4
      vector/v.net/connect.c

+ 11 - 4
vector/v.net/connect.c

@@ -29,6 +29,11 @@ int connect_arcs(struct Map_info *In, struct Map_info *Pnts,
     struct line_cats *Cats, *Cline, *Cnew;
     int maxcat, findex, ncats;
 
+    struct ilist *exclude_list;
+    int pline;
+
+    exclude_list = Vect_new_list();
+
     narcs = 0;
 
     Points = Vect_new_line_struct();
@@ -53,9 +58,9 @@ int connect_arcs(struct Map_info *In, struct Map_info *Pnts,
 	    continue;
 
 	/* find the nearest line in given threshold */
-	line = Vect_find_line(Out,
-			      Points->x[0], Points->y[0], Points->z[0],
-			      GV_LINES, thresh, WITHOUT_Z, 0);
+	line = Vect_find_line_list(Out, Points->x[0], Points->y[0], Points->z[0],
+				   GV_LINES, thresh, WITHOUT_Z, 
+				   exclude_list, NULL);
 
 	if (line < 1 || !Vect_line_alive(Out, line))
 	    continue;
@@ -114,7 +119,9 @@ int connect_arcs(struct Map_info *In, struct Map_info *Pnts,
 		maxcat++;
 		Vect_reset_cats(Cnew);
 		Vect_cat_set(Cnew, afield, maxcat);
-		Vect_write_line(Out, ltype, Pout, Cnew);
+		pline = Vect_write_line(Out, ltype, Pout, Cnew);
+		
+		Vect_list_append(exclude_list, pline);
 
 		narcs++;
 	    }