[GRASS-SVN] r66422 - grass/trunk/vector/v.mkgrid

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 6 07:30:18 PDT 2015


Author: martinl
Date: 2015-10-06 07:30:18 -0700 (Tue, 06 Oct 2015)
New Revision: 66422

Modified:
   grass/trunk/vector/v.mkgrid/main.c
   grass/trunk/vector/v.mkgrid/write_grid.c
Log:
v.mkgrid: finish progress (G_percent) info, be less verbose about progress

Modified: grass/trunk/vector/v.mkgrid/main.c
===================================================================
--- grass/trunk/vector/v.mkgrid/main.c	2015-10-06 14:08:59 UTC (rev 66421)
+++ grass/trunk/vector/v.mkgrid/main.c	2015-10-06 14:30:18 UTC (rev 66422)
@@ -413,7 +413,7 @@
 	}
 
 	/* Create a grid of label points at the centres of the grid cells */
-	G_verbose_message(_("Creating centroids..."));
+	G_message(_("Creating centroids..."));
 
 	/* Write out centroids and attributes */
 	/* If the output id is lines it skips to add centroids and attributes
@@ -423,6 +423,7 @@
             db_begin_transaction(Driver);
 	    attCount = 0;
 	    for (i = 0; i < grid_info.num_rows; ++i) {
+                G_percent(i, grid_info.num_rows, 2);
 	        for (j = 0; j < grid_info.num_cols; ++j) {
 		    double x, y;
 
@@ -464,6 +465,7 @@
 		    attCount++;
 	        }
 	    }
+            G_percent(1, 1, 1);
 	}
     }
     db_commit_transaction(Driver);

Modified: grass/trunk/vector/v.mkgrid/write_grid.c
===================================================================
--- grass/trunk/vector/v.mkgrid/write_grid.c	2015-10-06 14:08:59 UTC (rev 66421)
+++ grass/trunk/vector/v.mkgrid/write_grid.c	2015-10-06 14:30:18 UTC (rev 66422)
@@ -65,7 +65,7 @@
      y_len = height / (1. * nbreaks + 1);
 
     /* write out all the vector lengths (x vectors) of the entire grid  */
-    G_verbose_message(_("Writing out vector rows..."));
+    G_message(_("Writing out vector rows..."));
     y = grid_info->south;
     for (i = 0; i < num_v_rows; ++i) {
 	double startx;
@@ -101,9 +101,10 @@
 	}
 	y += height;
     }
-
+    G_percent(1, 1, 1);
+    
     /* write out all the vector widths (y vectors) of the entire grid  */
-    G_verbose_message(_("Writing out vector columns..."));
+    G_message(_("Writing out vector columns..."));
     x = grid_info->west;
     for (i = 0; i < num_v_cols; ++i) {
         double starty;
@@ -138,7 +139,8 @@
 	}
 	x += width;
     }
-
+    G_percent(1, 1, 1);
+    
     /* new with Vlib */
     Vect_destroy_line_struct(Points);
 



More information about the grass-commit mailing list