Преглед изворни кода

d.vect: fix overlap tests

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70640 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz пре 8 година
родитељ
комит
224d2f4394
2 измењених фајлова са 9 додато и 11 уклоњено
  1. 2 4
      display/d.vect/area.c
  2. 7 7
      display/d.vect/main.c

+ 2 - 4
display/d.vect/area.c

@@ -72,10 +72,8 @@ int display_area(struct Map_info *Map, struct cat_list *Clist, const struct Cell
 	    box.E < window->west || box.W > window->east) {
 	    if (window->proj != PROJECTION_LL)
 		continue;
-	    else { /* out of bounds for -180 to 180, try 0 to 360 as well */
-		if (box.N < window->south || box.S > window->north)
-		    continue;
-		if (box.E + 360 < window->west || box.W + 360 > window->east)
+	    else {
+		if (!G_window_overlap(window, box.N, box.S, box.E, box.W))
 		    continue;
 	    }
 	}

+ 7 - 7
display/d.vect/main.c

@@ -418,19 +418,19 @@ int main(int argc, char **argv)
 
     G_verbose_message(_("Plotting..."));
 
-    if (level >= 2)
+    overlap = 1;
+    if (level >= 2 && window.proj != PROJECTION_LL) {
 	Vect_get_map_box(&Map, &box);
+	overlap = G_window_percentage_overlap(&window, box.N, box.S,
+					      box.E, box.W);
+	G_debug(1, "overlap = %f \n", overlap);
+    }
 
-    if (level >= 2 && (window.north < box.S || window.south > box.N ||
-		       window.east < box.W ||
-		       window.west > G_adjust_easting(box.E, &window))) {
+    if (overlap == 0) {
 	G_warning(_("The bounding box of the map is outside the current region, "
 		    "nothing drawn"));
     }
     else {
-	overlap = G_window_percentage_overlap(&window, box.N, box.S,
-					      box.E, box.W);
-	G_debug(1, "overlap = %f \n", overlap);
 	if (overlap < 1)
 	    Vect_set_constraint_region(&Map, window.north, window.south,
 				       window.east, window.west,