浏览代码

select 3D lines with 2D polygon

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40383 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 年之前
父节点
当前提交
309fab1b5f
共有 1 个文件被更改,包括 10 次插入7 次删除
  1. 10 7
      lib/vector/Vlib/sindex.c

+ 10 - 7
lib/vector/Vlib/sindex.c

@@ -90,15 +90,16 @@ Vect_select_areas_by_box(struct Map_info *Map, const struct bound_box * Box,
 			 struct ilist *list)
 {
     int i;
-    const char *dstr;
-    int debug_level;
+    static int debug_level = -1;
 
-    dstr = G__getenv("DEBUG");
+    if (debug_level == -1) {
+	const char *dstr = G__getenv("DEBUG");
 
-    if (dstr != NULL)
-	debug_level = atoi(dstr);
-    else
-	debug_level = 0;
+	if (dstr != NULL)
+	    debug_level = atoi(dstr);
+	else
+	    debug_level = 0;
+    }
 
     G_debug(3, "Vect_select_areas_by_box()");
     G_debug(3, "Box(N,S,E,W,T,B): %e, %e, %e, %e, %e, %e", Box->N, Box->S,
@@ -224,6 +225,8 @@ Vect_select_lines_by_polygon(struct Map_info *Map, struct line_pnts *Polygon,
 
     /* Select first all lines by box */
     dig_line_box(Polygon, &box);
+    box.T = PORT_DOUBLE_MAX;
+    box.B = -PORT_DOUBLE_MAX;
     Vect_select_lines_by_box(Map, &box, type, LocList);
     G_debug(3, "  %d lines selected by box", LocList->n_values);