[GRASS-SVN] r43043 - grass/trunk/vector/v.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 11 12:37:20 EDT 2010


Author: mmetz
Date: 2010-08-11 16:37:20 +0000 (Wed, 11 Aug 2010)
New Revision: 43043

Modified:
   grass/trunk/vector/v.distance/main.c
Log:
speed: account for special cases

Modified: grass/trunk/vector/v.distance/main.c
===================================================================
--- grass/trunk/vector/v.distance/main.c	2010-08-11 12:51:12 UTC (rev 43042)
+++ grass/trunk/vector/v.distance/main.c	2010-08-11 16:37:20 UTC (rev 43043)
@@ -600,6 +600,7 @@
 	    tline = 0;
 	    dist = PORT_DOUBLE_MAX;
 	    for (i = 0; i < List->n_values; i++) {
+		tmp_tcat = -1;
 		Vect_read_line(&To, TPoints, TCats, List->value[i]);
 
 		tseg =
@@ -680,11 +681,6 @@
 		     * line bbox overlaps with search box, line itself is outside search box */
 		    enlarge = 1;
 		    fline--;
-		    box_edge = max / (enlarge_idx * enlarge_idx);
-		    while (box_edge < dist && enlarge_idx > 1) {
-			enlarge_idx -= 2;
-			box_edge = max / (enlarge_idx * enlarge_idx);
-		    }
 		}
 		else if (tline == 0 && enlarge_idx > 1) {
 		    /* no line within max dist, but search box can still be enlarged */
@@ -897,11 +893,6 @@
 		     * area bbox overlaps with search box, area itself is outside search box */
 		    enlarge = 1;
 		    fline--;
-		    box_edge = max / (enlarge_idx * enlarge_idx);
-		    while (box_edge < dist && enlarge_idx > 1) {
-			enlarge_idx -= 2;
-			box_edge = max / (enlarge_idx * enlarge_idx);
-		    }
 		}
 		else if (tarea == 0 && enlarge_idx > 1) {
 		    /* no area within max dist, but search box can still be enlarged */



More information about the grass-commit mailing list