[GRASS-SVN] r73497 - grass/trunk/raster/r.info

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 8 09:15:42 PDT 2018


Author: mmetz
Date: 2018-10-08 09:15:42 -0700 (Mon, 08 Oct 2018)
New Revision: 73497

Modified:
   grass/trunk/raster/r.info/main.c
Log:
r.info -s: always report total number of cells

Modified: grass/trunk/raster/r.info/main.c
===================================================================
--- grass/trunk/raster/r.info/main.c	2018-10-08 09:24:30 UTC (rev 73496)
+++ grass/trunk/raster/r.info/main.c	2018-10-08 16:15:42 UTC (rev 73497)
@@ -424,6 +424,12 @@
 		G_free(dbuf);
 	    }
 
+	    if (!gflag->answer) {
+		/* always report total number of cells */
+		fprintf(out, "cells=%jd\n",
+			(grass_int64)cellhd.rows * cellhd.cols);
+	    }
+
 	    if (rstats.count > 0) {
 		double mean, sd;
 		



More information about the grass-commit mailing list