[GRASS-SVN] r73623 - in grass/trunk: lib/raster raster/r.buildvrt
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 30 04:43:57 PDT 2018
Author: mmetz
Date: 2018-10-30 04:43:57 -0700 (Tue, 30 Oct 2018)
New Revision: 73623
Modified:
grass/trunk/lib/raster/get_row.c
grass/trunk/raster/r.buildvrt/link.c
grass/trunk/raster/r.buildvrt/main.c
Log:
virtual raster: fix embed nulls and stats in metadata
Modified: grass/trunk/lib/raster/get_row.c
===================================================================
--- grass/trunk/lib/raster/get_row.c 2018-10-30 02:46:08 UTC (rev 73622)
+++ grass/trunk/lib/raster/get_row.c 2018-10-30 11:43:57 UTC (rev 73623)
@@ -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/trunk/raster/r.buildvrt/link.c
===================================================================
--- grass/trunk/raster/r.buildvrt/link.c 2018-10-30 02:46:08 UTC (rev 73622)
+++ grass/trunk/raster/r.buildvrt/link.c 2018-10-30 11:43:57 UTC (rev 73623)
@@ -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/trunk/raster/r.buildvrt/main.c
===================================================================
--- grass/trunk/raster/r.buildvrt/main.c 2018-10-30 02:46:08 UTC (rev 73622)
+++ grass/trunk/raster/r.buildvrt/main.c 2018-10-30 11:43:57 UTC (rev 73623)
@@ -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