[GRASS-SVN] r70641 - grass/trunk/display/d.vect.thematic

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 20 06:07:33 PST 2017


Author: mmetz
Date: 2017-02-20 06:07:33 -0800 (Mon, 20 Feb 2017)
New Revision: 70641

Modified:
   grass/trunk/display/d.vect.thematic/area.c
   grass/trunk/display/d.vect.thematic/main.c
Log:
d.vect.thematic: fix overlap tests

Modified: grass/trunk/display/d.vect.thematic/area.c
===================================================================
--- grass/trunk/display/d.vect.thematic/area.c	2017-02-20 14:06:34 UTC (rev 70640)
+++ grass/trunk/display/d.vect.thematic/area.c	2017-02-20 14:07:33 UTC (rev 70641)
@@ -52,11 +52,9 @@
 
 	    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.thematic/main.c
===================================================================
--- grass/trunk/display/d.vect.thematic/main.c	2017-02-20 14:06:34 UTC (rev 70640)
+++ grass/trunk/display/d.vect.thematic/main.c	2017-02-20 14:07:33 UTC (rev 70641)
@@ -461,20 +461,21 @@
 	if (verbose)
 	    G_message(_("Plotting ..."));
 
+	overlap = 1;
 	Vect_get_map_box(&Map, &box);
+	if (window.proj != PROJECTION_LL) {
+	    overlap =
+		G_window_percentage_overlap(&window, box.N, box.S,
+		                            box.E, box.W);
+	    G_debug(1, "overlap = %f \n", overlap);
+	}
 
-	if (window.north < box.S || window.south > box.N ||
-	    window.east < box.W ||
-	    window.west > G_adjust_easting(box.E, &window)) {
+	if (overlap == 0) {
 	    G_message(_("The bounding box of the map is outside the current region, "
 		       "nothing drawn."));
 	    stat = 0;
 	}
 	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,
@@ -483,18 +484,18 @@
 	    /* default line width */
 	    D_line_width(default_width);
 
-        if (Vect_get_num_primitives(&Map, GV_BOUNDARY) > 0)
-	    stat =
-		dareatheme(&Map, Clist, &cvarr, breakpoints, nbreaks, colors,
-			   has_color ? &bcolor : NULL, chcat, &window,
-			   default_width);
+	    if (Vect_get_num_primitives(&Map, GV_BOUNDARY) > 0)
+		stat =
+		    dareatheme(&Map, Clist, &cvarr, breakpoints, nbreaks, colors,
+			       has_color ? &bcolor : NULL, chcat, &window,
+			       default_width);
 
-        else if ((Vect_get_num_primitives(&Map, GV_POINT) > 0) ||
-                 (Vect_get_num_primitives(&Map, GV_LINE) > 0)){
-            stat = display_lines(&Map, Clist, chcat, icon_opt->answer, size,
-                   default_width, &cvarr, breakpoints, nbreaks, colors,
-                   has_color ? &bcolor : NULL);
-        }
+	    else if ((Vect_get_num_primitives(&Map, GV_POINT) > 0) ||
+		     (Vect_get_num_primitives(&Map, GV_LINE) > 0)){
+		stat = display_lines(&Map, Clist, chcat, icon_opt->answer, size,
+		       default_width, &cvarr, breakpoints, nbreaks, colors,
+		       has_color ? &bcolor : NULL);
+	    }
 
 
 	    /* reset line width: Do we need to get line width from display



More information about the grass-commit mailing list