[GRASS-SVN] r61988 - grass/branches/develbranch_6/vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 15 23:32:31 PDT 2014


Author: mmetz
Date: 2014-09-15 23:32:31 -0700 (Mon, 15 Sep 2014)
New Revision: 61988

Modified:
   grass/branches/develbranch_6/vector/v.distance/main.c
Log:
v.distance: fix #2419

Modified: grass/branches/develbranch_6/vector/v.distance/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.distance/main.c	2014-09-16 06:32:06 UTC (rev 61987)
+++ grass/branches/develbranch_6/vector/v.distance/main.c	2014-09-16 06:32:31 UTC (rev 61988)
@@ -692,6 +692,10 @@
 
 		area = List->value[i];
 		G_debug(4, "%d: area %d", i, area);
+		
+		if (Vect_get_area_centroid(&To, area) == 0)
+		    continue;
+
 		Vect_get_area_points(&To, area, TPoints);
 
 		/* Find the distance to this area */
@@ -736,12 +740,6 @@
                                       FPoints->z[0]);
                     Vect_append_point(LLPoints, tmp_tx, tmp_ty, tmp_tz);
                     tmp_dist = Vect_line_geodesic_length(LLPoints);
-                    Vect_reset_line(LLPoints);
-                    for (k = 0; k < tseg; k++)
-                        Vect_append_point(LLPoints, TPoints->x[k],
-                                          TPoints->y[k], TPoints->z[k]);
-                    Vect_append_point(LLPoints, tmp_tx, tmp_ty, tmp_tz);
-                    tmp_talong = Vect_line_geodesic_length(LLPoints);
                 }
 
 		/* TODO: all cats of given field ? */



More information about the grass-commit mailing list