[GRASS-SVN] r55364 - grass/trunk/vector/v.overlay
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 13 07:48:28 PDT 2013
Author: mmetz
Date: 2013-03-13 07:48:28 -0700 (Wed, 13 Mar 2013)
New Revision: 55364
Modified:
grass/trunk/vector/v.overlay/line_area.c
Log:
v.overlay reduce IO
Modified: grass/trunk/vector/v.overlay/line_area.c
===================================================================
--- grass/trunk/vector/v.overlay/line_area.c 2013-03-13 14:47:13 UTC (rev 55363)
+++ grass/trunk/vector/v.overlay/line_area.c 2013-03-13 14:48:28 UTC (rev 55364)
@@ -53,14 +53,14 @@
/* merge a given line with all other lines of the same type and
* with the same categories */
static int merge_line(struct Map_info *Map, int line,
- struct line_pnts *MPoints)
+ struct line_pnts *MPoints, struct line_cats *MCats)
{
int nlines, i, first, last, next_line, curr_line;
int merged = 0, newl = 0;
int next_node, direction, node_n_lines, type, ltype, lines_type;
static struct ilist *List = NULL;
static struct line_pnts *Points = NULL;
- static struct line_cats *MCats = NULL, *Cats = NULL;
+ static struct line_cats *Cats = NULL;
type = GV_LINE;
nlines = Vect_get_num_lines(Map);
@@ -69,8 +69,6 @@
Points = Vect_new_line_struct();
if (!Cats)
Cats = Vect_new_cats_struct();
- if (!MCats)
- MCats = Vect_new_cats_struct();
if (!List)
List = Vect_new_list();
@@ -87,7 +85,7 @@
if (!(ltype & type))
return 0;
- Vect_read_line(Map, NULL, MCats, line);
+ Vect_read_line(Map, MPoints, MCats, line);
/* special cases:
* - loop back to start boundary via several other boundaries
@@ -281,7 +279,7 @@
if (!Vect_line_alive(Tmp, line))
continue;
- ltype = Vect_read_line(Tmp, Points, Cats, line);
+ ltype = Vect_get_line_type(Tmp, line);
if (ltype == GV_BOUNDARY) { /* No more needed */
continue;
@@ -308,7 +306,7 @@
*/
/* merge here */
- merge_line(Tmp, line, Points);
+ merge_line(Tmp, line, Points, Cats);
G_debug(3, "line = %d", line);
More information about the grass-commit
mailing list