소스 검색

v.generalize: update topology test

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64261 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 10 년 전
부모
커밋
1182a67bcd
1개의 변경된 파일17개의 추가작업 그리고 15개의 파일을 삭제
  1. 17 15
      vector/v.generalize/misc.c

+ 17 - 15
vector/v.generalize/misc.c

@@ -681,12 +681,12 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 
     /* 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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 
 		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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 
 		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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 		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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 		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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 	    }
 
 	    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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 		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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 		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 @@ int check_topo(struct Map_info *Out, int line, struct line_pnts *APoints,
 	    }
 
 	    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)