[GRASS-SVN] r70640 - grass/trunk/display/d.vect
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 20 06:06:35 PST 2017
Author: mmetz
Date: 2017-02-20 06:06:34 -0800 (Mon, 20 Feb 2017)
New Revision: 70640
Modified:
grass/trunk/display/d.vect/area.c
grass/trunk/display/d.vect/main.c
Log:
d.vect: fix overlap tests
Modified: grass/trunk/display/d.vect/area.c
===================================================================
--- grass/trunk/display/d.vect/area.c 2017-02-20 08:00:39 UTC (rev 70639)
+++ grass/trunk/display/d.vect/area.c 2017-02-20 14:06:34 UTC (rev 70640)
@@ -72,11 +72,9 @@
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)
+ else {
+ if (!G_window_overlap(window, box.N, box.S, box.E, box.W))
continue;
- if (box.E + 360 < window->west || box.W + 360 > window->east)
- continue;
}
}
Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c 2017-02-20 08:00:39 UTC (rev 70639)
+++ grass/trunk/display/d.vect/main.c 2017-02-20 14:06:34 UTC (rev 70640)
@@ -418,19 +418,19 @@
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,
More information about the grass-commit
mailing list