[GRASS-dev] v.clean tool=break fails

Martin Landa landa.martin at gmail.com
Sat Nov 30 03:26:25 PST 2013


Hi all,

recently I found problem when breaking lines using `v.clean`.

I have a patched map that contains boundaries and centroids.

$ v.info x3 -t
nodes=8219
points=0
lines=0
boundaries=11807
centroids=4876
areas=4875
islands=1222
primitives=16683
map3d=0

When I try to break lines on intersections `v.clean` fails because it
tries to read nodes from centroids (which obviously fails).

$ v.clean in=x3 out=x4 tool=break --o
...
Tool: Break lines at intersections
0..ERROR: Nodes not available for line 11725

Defining `type` explicitly helps

$ v.clean in=x3 out=x4 tool=break --o type=boundary

In the attachment you can find a patch which seems to fix this issue.
I am just not sure about possible side-efects.

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
-------------- next part --------------
Index: lib/vector/Vlib/break_lines.c
===================================================================
--- lib/vector/Vlib/break_lines.c	(revision 58335)
+++ lib/vector/Vlib/break_lines.c	(working copy)
@@ -245,7 +245,7 @@
 	}
 
 	atype = Vect_read_line(Map, APoints, ACats, aline);
-	if (!(atype & type))
+	if (atype & GV_POINTS || !(atype & type))
 	    continue;
 
 	Vect_line_prune(APoints);
@@ -281,7 +281,7 @@
 		    touch2_s, touch2_e, touch2_w);
 	}
 
-	Vect_select_lines_by_box(Map, &ABox, type, List);
+	Vect_select_lines_by_box(Map, &ABox, type &= ~GV_POINTS, List);
 	G_debug(3, "  %d lines selected by box", List->n_values);
 
 	for (j = -1; j < List->n_values; j++) {


More information about the grass-dev mailing list