[GRASS-dev] Deleteing vector lines

Wolf Bergenheim wolf+grass at bergenheim.net
Tue Jun 6 02:46:06 EDT 2006


Hi,

What must be done to delete vector lines from a vector map?

I'm currently trying to do:
 	for(cat=cl->min[i]; cat <= cl->max[i]; cat++) {
 	    ret = Vect_cidx_find_next(Map, layer, cat, GV_POINTS|GV_LINES,
 				      0, &type, &id);
 	    if(ret<0) continue;
 	    if(type==GV_CENTROID) {
 		int area;
 		double x,y;
 		Vect_get_node_coor(Map, id, &x, &y, NULL);
 		area = Vect_find_area(Map, x, y);
 		Vect_delete_line(Map, id);
 		Vect_delete_line(Map, area);
 		attr_del(Map, layer, cat);
 	    }
 	    else {
 		Vect_delete_line(Map, id);
 		attr_del(Map, layer, cat);


but when it calls Vect_cidx_find_next the second time I get a fatal error 
saying:
ERROR: Category index is not up to date
and then it exits. So I guess I'm asking how do I update the category 
index? Should I call Vect_cidx_save()? If I do, do I then need to 
Vect_cidx_open()?

--Wolf

-- 

<:3 )---- Wolf Bergenheim ----( 8:>




More information about the grass-dev mailing list