[GRASS-SVN] r55909 - grass/trunk/vector/v.clean

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 19 01:07:15 PDT 2013


Author: mmetz
Date: 2013-04-19 01:07:14 -0700 (Fri, 19 Apr 2013)
New Revision: 55909

Modified:
   grass/trunk/vector/v.clean/main.c
Log:
v.clean: enable -c flag also for lines

Modified: grass/trunk/vector/v.clean/main.c
===================================================================
--- grass/trunk/vector/v.clean/main.c	2013-04-19 07:42:44 UTC (rev 55908)
+++ grass/trunk/vector/v.clean/main.c	2013-04-19 08:07:14 UTC (rev 55909)
@@ -347,18 +347,18 @@
 
 	switch (tools[i]) {
 	case TOOL_BREAK:
-	    if (flag.combine->answer && (otype & GV_BOUNDARY)) {
-		G_message(_("Tool: Split boundaries"));
-		split_lines(&Out, GV_BOUNDARY, pErr);
+	    if (flag.combine->answer && (otype & GV_LINES)) {
+		G_message(_("Tool: Split lines"));
+		split_lines(&Out, otype, pErr);
 	    }
 	    G_message(_("Tool: Break lines at intersections"));
 	    Vect_break_lines(&Out, otype, pErr);
 	    if (flag.combine->answer) {
 		G_message(_("Tool: Remove duplicates"));
 		Vect_remove_duplicates(&Out, otype, pErr);
-		if (otype & GV_BOUNDARY) {
-		    G_message(_("Tool: Merge boundaries"));
-		    Vect_merge_lines(&Out, GV_BOUNDARY, NULL, pErr);
+		if (otype & GV_LINES) {
+		    G_message(_("Tool: Merge lines"));
+		    Vect_merge_lines(&Out, otype, NULL, pErr);
 		}
 	    }
 	    break;
@@ -392,9 +392,9 @@
 	    if (flag.combine->answer) {
 		int nmod;
 
-		if (otype & GV_BOUNDARY) {
-		    G_message(_("Tool: Split boundaries"));
-		    split_lines(&Out, GV_BOUNDARY, pErr);
+		if (otype & GV_LINES) {
+		    G_message(_("Tool: Split lines"));
+		    split_lines(&Out, otype, pErr);
 		}
 		do {
 		    G_message(_("Tool: Break lines at intersections"));
@@ -405,9 +405,9 @@
 		    nmod =
 			Vect_clean_small_angles_at_nodes(&Out, otype, pErr);
 		} while (nmod > 0);
-		if (otype & GV_BOUNDARY) {
-		    G_message(_("Tool: Merge boundaries"));
-		    Vect_merge_lines(&Out, GV_BOUNDARY, NULL, pErr);
+		if (otype & GV_LINES) {
+		    G_message(_("Tool: Merge lines"));
+		    Vect_merge_lines(&Out, otype, NULL, pErr);
 		}
 	    }
 	    break;
@@ -427,6 +427,10 @@
 	    G_message(_("Tool: Remove small areas"));
 	    count =
 		Vect_remove_small_areas(&Out, threshs[i], pErr, &size);
+	    if (flag.combine->answer && count > 0) {
+		G_message(_("Tool: Merge boundaries"));
+		Vect_merge_lines(&Out, GV_BOUNDARY, NULL, pErr);
+	    }
 	    break;
 	case TOOL_RMSA:
 	    G_message(_("Tool: Remove small angles at nodes"));
@@ -437,9 +441,9 @@
 	    else {
 		int nmod;
 
-		if (otype & GV_BOUNDARY) {
-		    G_message(_("Tool: Split boundaries"));
-		    split_lines(&Out, GV_BOUNDARY, pErr);
+		if (otype & GV_LINES) {
+		    G_message(_("Tool: Split lines"));
+		    split_lines(&Out, otype, pErr);
 		}
 		while ((nmod =
 		          Vect_clean_small_angles_at_nodes(&Out, otype, pErr)) > 0) {
@@ -450,9 +454,9 @@
 		    Vect_remove_duplicates(&Out, otype, pErr);
 		    G_message(_("Tool: Remove small angles at nodes"));
 		}
-		if (otype & GV_BOUNDARY) {
-		    G_message(_("Tool: Merge boundaries"));
-		    Vect_merge_lines(&Out, GV_BOUNDARY, NULL, pErr);
+		if (otype & GV_LINES) {
+		    G_message(_("Tool: Merge lines"));
+		    Vect_merge_lines(&Out, otype, NULL, pErr);
 		}
 	    }
 	    break;



More information about the grass-commit mailing list