[GRASS-SVN] r43611 - grass/branches/releasebranch_6_4/vector/v.clean

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 22 09:49:17 EDT 2010


Author: neteler
Date: 2010-09-22 13:49:17 +0000 (Wed, 22 Sep 2010)
New Revision: 43611

Modified:
   grass/branches/releasebranch_6_4/vector/v.clean/prune.c
   grass/branches/releasebranch_6_4/vector/v.clean/rmdac.c
   grass/branches/releasebranch_6_4/vector/v.clean/rmline.c
Log:
backport: G_percent() and verbose cleanup

Modified: grass/branches/releasebranch_6_4/vector/v.clean/prune.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.clean/prune.c	2010-09-22 10:00:32 UTC (rev 43610)
+++ grass/branches/releasebranch_6_4/vector/v.clean/prune.c	2010-09-22 13:49:17 UTC (rev 43611)
@@ -60,6 +60,8 @@
 
     for (line = 1; line <= nlines; line++) {
 
+	G_percent(line, nlines, 1);
+
 	if (!Vect_line_alive(Out, line))
 	    continue;
 
@@ -160,7 +162,7 @@
 
 	    if (intersect) {
 		G_debug(3,
-			"The pruned boundary instersects another boundary -> not pruned");
+			"The pruned boundary intersects another boundary -> not pruned");
 		not_pruned_lines++;
 		continue;
 	    }

Modified: grass/branches/releasebranch_6_4/vector/v.clean/rmdac.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.clean/rmdac.c	2010-09-22 10:00:32 UTC (rev 43610)
+++ grass/branches/releasebranch_6_4/vector/v.clean/rmdac.c	2010-09-22 13:49:17 UTC (rev 43611)
@@ -34,10 +34,10 @@
     G_debug(1, "nlines =  %d", nlines);
 
     ndupl = 0;
-    if (G_verbose() > G_verbose_min())
-	fprintf(stderr, _("Duplicate area centroids: %5d"), ndupl);
 
     for (i = 1; i <= nlines; i++) {
+	G_percent(i, nlines, 2);
+
 	if (!Vect_line_alive(Out, i))
 	    continue;
 
@@ -52,18 +52,13 @@
 	    Vect_delete_line(Out, i);
 	    ndupl++;
 
-	    if (G_verbose() > G_verbose_min())
-		fprintf(stderr, "\r%s: %5d", _("Duplicate area centroids"),
-			ndupl);
-
 	    if (Err) {
 		Vect_write_line(Err, type, Points, Cats);
 	    }
 	}
     }
 
-    if (G_verbose() > G_verbose_min())
-	fprintf(stderr, "\n");
+    G_verbose_message(_("Duplicate area centroids: %d"), ndupl);
 
     Vect_destroy_line_struct(Points);
     Vect_destroy_cats_struct(Cats);

Modified: grass/branches/releasebranch_6_4/vector/v.clean/rmline.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.clean/rmline.c	2010-09-22 10:00:32 UTC (rev 43610)
+++ grass/branches/releasebranch_6_4/vector/v.clean/rmline.c	2010-09-22 13:49:17 UTC (rev 43611)
@@ -37,6 +37,8 @@
     G_debug(1, "nlines =  %d", nlines);
 
     for (line = 1; line <= nlines; line++) {
+	G_percent(line, nlines, 1);
+
 	if (!Vect_line_alive(Map, line))
 	    continue;
 
@@ -57,6 +59,8 @@
 	count++;
     }
 
+    G_verbose_message(_("Lines / boundaries removed: %d"), count);
+
     Vect_destroy_line_struct(Points);
     Vect_destroy_cats_struct(Cats);
 



More information about the grass-commit mailing list