[GRASS-SVN] r73624 - in grass/branches/releasebranch_7_6: lib/raster raster/r.buildvrt

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 30 04:44:44 PDT 2018


Author: mmetz
Date: 2018-10-30 04:44:44 -0700 (Tue, 30 Oct 2018)
New Revision: 73624

Modified:
   grass/branches/releasebranch_7_6/lib/raster/get_row.c
   grass/branches/releasebranch_7_6/raster/r.buildvrt/link.c
   grass/branches/releasebranch_7_6/raster/r.buildvrt/main.c
Log:
virtual raster: fix embed nulls and stats in metadata (backport trunk r73623)

Modified: grass/branches/releasebranch_7_6/lib/raster/get_row.c
===================================================================
--- grass/branches/releasebranch_7_6/lib/raster/get_row.c	2018-10-30 11:43:57 UTC (rev 73623)
+++ grass/branches/releasebranch_7_6/lib/raster/get_row.c	2018-10-30 11:44:44 UTC (rev 73624)
@@ -909,6 +909,12 @@
 	    flags[j] = 1;
 	return;
     }
+    if (fcb->vrt) {
+	/* vrt: already done when reading the real maps, no extra NULL values */
+	for (j = 0; j < R__.rd_window.cols; j++)
+	    flags[j] = 0;
+	return;
+    }
 
     if (row != fcb->null_cur_row) {
 	if (!Rast__read_null_bits(fd, row, fcb->null_bits)) {

Modified: grass/branches/releasebranch_7_6/raster/r.buildvrt/link.c
===================================================================
--- grass/branches/releasebranch_7_6/raster/r.buildvrt/link.c	2018-10-30 11:43:57 UTC (rev 73623)
+++ grass/branches/releasebranch_7_6/raster/r.buildvrt/link.c	2018-10-30 11:44:44 UTC (rev 73624)
@@ -115,8 +115,11 @@
 	write_fp_quant(output);
     }
     G_remove_misc("cell_misc", "stats", output);
+#if 0
+    /* does not work with overlapping tiles */
     if (have_stats)
 	Rast_write_rstats(output, ostats);
+#endif
 
     G_verbose_message(_("Creating support files for %s"), output);
     Rast_short_history(output, "virtual", &history);

Modified: grass/branches/releasebranch_7_6/raster/r.buildvrt/main.c
===================================================================
--- grass/branches/releasebranch_7_6/raster/r.buildvrt/main.c	2018-10-30 11:43:57 UTC (rev 73623)
+++ grass/branches/releasebranch_7_6/raster/r.buildvrt/main.c	2018-10-30 11:44:44 UTC (rev 73624)
@@ -285,7 +285,7 @@
 	    }
 	}
 	if (have_stats && 
-	    Rast_read_rstats(inputs[0].name, inputs[0].mapset, &rstats) == 1) {
+	    Rast_read_rstats(p->name, p->mapset, &rstats) == 1) {
 	    ostats.sum += rstats.sum;
 	    ostats.sumsq += rstats.sumsq;
 	    ostats.count += rstats.count;



More information about the grass-commit mailing list