瀏覽代碼

speed: account for special cases

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43043 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 年之前
父節點
當前提交
55db8b3b6b
共有 1 個文件被更改,包括 1 次插入10 次删除
  1. 1 10
      vector/v.distance/main.c

+ 1 - 10
vector/v.distance/main.c

@@ -600,6 +600,7 @@ int main(int argc, char *argv[])
 	    tline = 0;
 	    tline = 0;
 	    dist = PORT_DOUBLE_MAX;
 	    dist = PORT_DOUBLE_MAX;
 	    for (i = 0; i < List->n_values; i++) {
 	    for (i = 0; i < List->n_values; i++) {
+		tmp_tcat = -1;
 		Vect_read_line(&To, TPoints, TCats, List->value[i]);
 		Vect_read_line(&To, TPoints, TCats, List->value[i]);
 
 
 		tseg =
 		tseg =
@@ -680,11 +681,6 @@ int main(int argc, char *argv[])
 		     * line bbox overlaps with search box, line itself is outside search box */
 		     * line bbox overlaps with search box, line itself is outside search box */
 		    enlarge = 1;
 		    enlarge = 1;
 		    fline--;
 		    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) {
 		else if (tline == 0 && enlarge_idx > 1) {
 		    /* no line within max dist, but search box can still be enlarged */
 		    /* no line within max dist, but search box can still be enlarged */
@@ -897,11 +893,6 @@ int main(int argc, char *argv[])
 		     * area bbox overlaps with search box, area itself is outside search box */
 		     * area bbox overlaps with search box, area itself is outside search box */
 		    enlarge = 1;
 		    enlarge = 1;
 		    fline--;
 		    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) {
 		else if (tarea == 0 && enlarge_idx > 1) {
 		    /* no area within max dist, but search box can still be enlarged */
 		    /* no area within max dist, but search box can still be enlarged */