[GRASS-SVN] r57996 - grass/trunk/vector/v.voronoi

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 14 07:42:39 PDT 2013


Author: mmetz
Date: 2013-10-14 07:42:39 -0700 (Mon, 14 Oct 2013)
New Revision: 57996

Modified:
   grass/trunk/vector/v.voronoi/main.c
   grass/trunk/vector/v.voronoi/skeleton.c
Log:
v.voronoi: fix skeleton extraction

Modified: grass/trunk/vector/v.voronoi/main.c
===================================================================
--- grass/trunk/vector/v.voronoi/main.c	2013-10-14 13:46:19 UTC (rev 57995)
+++ grass/trunk/vector/v.voronoi/main.c	2013-10-14 14:42:39 UTC (rev 57996)
@@ -324,11 +324,12 @@
 	if (!(type & GV_POINTS))
 	    continue;
 
-	if (!Vect_point_in_box(Points->x[0], Points->y[0], 0.0, &Box))
-	    continue;
+	if (!skeleton)
+	    if (!Vect_point_in_box(Points->x[0], Points->y[0], 0.0, &Box))
+		continue;
 
-	if (!skeleton)
 	    Vect_write_line(&Out, ctype, Points, Cats);
+	}
 
 	for (i = 0; i < Cats->n_cats; i++) {
 	    int f, j;

Modified: grass/trunk/vector/v.voronoi/skeleton.c
===================================================================
--- grass/trunk/vector/v.voronoi/skeleton.c	2013-10-14 13:46:19 UTC (rev 57995)
+++ grass/trunk/vector/v.voronoi/skeleton.c	2013-10-14 14:42:39 UTC (rev 57996)
@@ -492,9 +492,6 @@
 	IPoints[i] = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();
 
-    IPoints = NULL;
-
-
     for (node = 1; node <= Vect_get_num_nodes(&Out); node++) {
 	if (!Vect_node_alive(&Out, node))
 	    continue;
@@ -523,9 +520,9 @@
 		IPoints[i] = Vect_new_line_struct();
 	    isl_allocated = n_isles;
 	}
-	for (isle = 0; isle < n_isles; isle++) {
-	    Vect_get_isle_points(&In, Vect_get_area_isle(&In, area, isle),
-	                         IPoints[isle]);
+	for (i = 0; i < n_isles; i++) {
+	    Vect_get_isle_points(&In, Vect_get_area_isle(&In, area, i),
+	                         IPoints[i]);
 	}
 
 	distmin = 1. / 0.; /* +inf */



More information about the grass-commit mailing list