[GRASS-dev] r.univar -g: output total as well

Markus Neteler neteler at osgeo.org
Wed Aug 19 17:00:19 EDT 2009


It would be nice to have the "total" output for
eval `r.univar -g rastermap`

svn diff raster/r.univar2/
Index: raster/r.univar2/stats.c
--- raster/r.univar2/stats.c    (revision 38620)
+++ raster/r.univar2/stats.c    (working copy)
@@ -108,6 +108,7 @@

     if (param.shell_style->answer) {
+       fprintf(stdout, "total=%d\n", stats->size);
        fprintf(stdout, "n=%d\n", stats->n);
        fprintf(stdout, "null_cells=%d\n", stats->size - stats->n);
        fprintf(stdout, "min=%.15g\n", stats->min);

Any objections (say, may it break any scripts)?

More information about the grass-dev mailing list