[GRASS-SVN] r64261 - grass/trunk/vector/v.generalize

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 20 11:46:28 PST 2015


Author: mmetz
Date: 2015-01-20 11:46:28 -0800 (Tue, 20 Jan 2015)
New Revision: 64261

Modified:
   grass/trunk/vector/v.generalize/misc.c
Log:
v.generalize: update topology test

Modified: grass/trunk/vector/v.generalize/misc.c
===================================================================
--- grass/trunk/vector/v.generalize/misc.c	2015-01-20 19:38:17 UTC (rev 64260)
+++ grass/trunk/vector/v.generalize/misc.c	2015-01-20 19:46:28 UTC (rev 64261)
@@ -681,12 +681,12 @@
 
     /* Check position of centroids */
     if (centr_l_n != centr_l_o || centr_r_n != centr_r_o) {
-	G_debug(1, "The modified boundary changes attachment of centroid -> not modified");
+	/* should not happen if the above topo checks work as expected */
+	G_warning("The modified boundary changes attachment of centroid -> topo checks failed");
 
 	if (centr_l_n != centr_l_o) {
-	    G_debug(1, "*************************************");
-	    G_debug(1, "Left area/isle old: %d, new: %d", left_o, left_n);
-	    G_debug(1, "Left centroid old: %d, new: %d", centr_l_o, centr_l_n);
+	    G_warning("Left area/isle old: %d, new: %d", left_o, left_n);
+	    G_warning("Left centroid old: %d, new: %d", centr_l_o, centr_l_n);
 
 	    if (centr_l_o) {
 		int ret1, ret2, ret3;
@@ -705,15 +705,14 @@
 
 		if (ret2 != ret3) {
 		    G_warning("Left old centroid in new area box: %d", ret1);
-		    G_warning("Left old centroid in new area as poly: %d", ret2);
-		    G_warning("Left old centroid in new area outer ring: %d", ret3);
+		    G_warning("Left old centroid in new area outer ring: %d", ret2);
+		    G_warning("Left old centroid in new area as poly: %d", ret3);
 		}
 	    }
 	}
 	if (centr_r_n != centr_r_o) {
-	    G_debug(1, "*************************************");
-	    G_debug(1, "Right area/isle old: %d, new: %d", right_o, right_n);
-	    G_debug(1, "Right centroid old: %d, new: %d", centr_r_o, centr_r_n);
+	    G_warning("Right area/isle old: %d, new: %d", right_o, right_n);
+	    G_warning("Right centroid old: %d, new: %d", centr_r_o, centr_r_n);
 
 	    if (centr_r_o) {
 		int ret1, ret2, ret3;
@@ -732,8 +731,8 @@
 
 		if (ret2 != ret3) {
 		    G_warning("Right old centroid in new area box: %d", ret1);
-		    G_warning("Right old centroid in new area as poly: %d", ret2);
-		    G_warning("Right old centroid in new area outer ring: %d", ret3);
+		    G_warning("Right old centroid in new area outer ring: %d", ret2);
+		    G_warning("Right old centroid in new area as poly: %d", ret3);
 		}
 	    }
 	}
@@ -765,7 +764,7 @@
 		if (Vect_point_in_area(BPoints->x[0], BPoints->y[0], Out,
 		    area_l_n, &areabox)) {
 
-		    G_warning("New left centroid is in new left area");
+		    G_warning("New left centroid is in new left area %d", area_l_n);
 
 		    G_warning("New left centroid on outer ring: %d",
 		    Vect_point_in_area_outer_ring(BPoints->x[0], BPoints->y[0], Out,
@@ -783,7 +782,7 @@
 		if (Vect_point_in_area(BPoints->x[0], BPoints->y[0], Out,
 		    area_l_n, &areabox)) {
 
-		    G_warning("Old left centroid is in new left area");
+		    G_warning("Old left centroid is in new left area %d", area_l_n);
 
 		    G_warning("Old left centroid on outer ring: %d",
 		    Vect_point_in_area_outer_ring(BPoints->x[0], BPoints->y[0], Out,
@@ -797,6 +796,7 @@
 	    }
 
 	    G_fatal_error("Left centroid old %d, restored %d", centr_l_o, centr_l_n);
+	    return 0;
 	}
 	if (centr_r_n != centr_r_o) {
 	    Vect_get_area_box(Out, area_r_n, &areabox);
@@ -806,7 +806,7 @@
 		if (Vect_point_in_area(BPoints->x[0], BPoints->y[0], Out,
 		    area_r_n, &areabox)) {
 
-		    G_warning("New right centroid is in new right area");
+		    G_warning("New right centroid is in new right area %d", area_r_n);
 
 		    G_warning("New right centroid on outer ring: %d",
 		    Vect_point_in_area_outer_ring(BPoints->x[0], BPoints->y[0], Out,
@@ -824,7 +824,7 @@
 		if (Vect_point_in_area(BPoints->x[0], BPoints->y[0], Out,
 		    area_r_n, &areabox)) {
 
-		    G_warning("Old right centroid is in new right area");
+		    G_warning("Old right centroid is in new right area %d", area_r_n);
 
 		    G_warning("Old right centroid on outer ring: %d",
 		    Vect_point_in_area_outer_ring(BPoints->x[0], BPoints->y[0], Out,
@@ -838,8 +838,10 @@
 	    }
 
 	    G_fatal_error("Right centroid old %d, restored %d", centr_r_o, centr_r_n);
+	    return 0;
 	}
 
+	G_fatal_error("Topology check failure");
 	return 0;
     }
     if (isles_l_o)



More information about the grass-commit mailing list