[GRASS-SVN] r70354 - grass/branches/releasebranch_7_2/raster/r.in.lidar

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 12 07:37:30 PST 2017


Author: martinl
Date: 2017-01-12 07:37:30 -0800 (Thu, 12 Jan 2017)
New Revision: 70354

Modified:
   grass/branches/releasebranch_7_2/raster/r.in.lidar/main.c
Log:
r.in.lidar (cosmetics): fix indent
           progress when writing output
           consolidate messages with r.in.xyz
           (merge r70352 from trunk)


Modified: grass/branches/releasebranch_7_2/raster/r.in.lidar/main.c
===================================================================
--- grass/branches/releasebranch_7_2/raster/r.in.lidar/main.c	2017-01-12 15:37:18 UTC (rev 70353)
+++ grass/branches/releasebranch_7_2/raster/r.in.lidar/main.c	2017-01-12 15:37:30 UTC (rev 70354)
@@ -599,7 +599,7 @@
     /* allocate memory for a single row of output data */
     raster_row = Rast_allocate_output_buf(rtype);
 
-    G_message(_("Reading data ..."));
+    G_message(_("Reading data..."));
 
     count_total = line_total = 0;
 
@@ -607,7 +607,7 @@
     for (pass = 1; pass <= npasses; pass++) {
 
 	if (npasses > 1)
-	    G_message(_("Pass #%d (of %d) ..."), pass, npasses);
+	    G_message(_("Pass #%d (of %d)..."), pass, npasses);
 
 	/* figure out segmentation */
 	row0 = (pass - 1) * rows;
@@ -624,7 +624,7 @@
 
 	G_debug(2, "pass=%d/%d  rows=%d", pass, npasses, rows);
 
-    point_binning_allocate(&point_binning, rows, cols, rtype);
+        point_binning_allocate(&point_binning, rows, cols, rtype);
 
 	line = 0;
 	count = 0;
@@ -746,13 +746,16 @@
 	line_total += line;
 
 	/* calc stats and output */
-	G_message(_("Writing to map ..."));
+	G_message(_("Writing output raster map..."));
 	for (row = 0; row < rows; row++) {
-        /* potentially vector writing can be independent on the binning */
-        write_values(&point_binning, &bin_index_nodes, raster_row, row,
-            cols, rtype, NULL);
+            /* potentially vector writing can be independent on the binning */
+            write_values(&point_binning, &bin_index_nodes, raster_row, row,
+                         cols, rtype, NULL);
+
+            G_percent(row, rows, 10);
+
 	    /* write out line of raster data */
-        Rast_put_row(out_fd, raster_row, rtype);
+            Rast_put_row(out_fd, raster_row, rtype);
 	}
 
 	/* free memory */
@@ -766,6 +769,8 @@
     G_percent(1, 1, 1);		/* flush */
     G_free(raster_row);
 
+    G_message(_("%lu points found in input file(s)"), line_total);
+
     /* close raster file & write history */
     Rast_close(out_fd);
 



More information about the grass-commit mailing list