[GRASS-SVN] r57441 - grass/trunk/raster/r.volume

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 10 09:31:26 PDT 2013


Author: martinl
Date: 2013-08-10 09:31:26 -0700 (Sat, 10 Aug 2013)
New Revision: 57441

Modified:
   grass/trunk/raster/r.volume/Makefile
   grass/trunk/raster/r.volume/main.c
   grass/trunk/raster/r.volume/r.volume.html
Log:
r.volume: major update to G7
          use vlib instead of sites
          fix writing centroid attributes
          update manual


Modified: grass/trunk/raster/r.volume/Makefile
===================================================================
--- grass/trunk/raster/r.volume/Makefile	2013-08-10 07:20:08 UTC (rev 57440)
+++ grass/trunk/raster/r.volume/Makefile	2013-08-10 16:31:26 UTC (rev 57441)
@@ -4,8 +4,8 @@
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-LIBES = $(SITESLIB) $(RASTERLIB) $(GISLIB)
-DEPENDENCIES = $(SITESDEP) $(RASTERDEP) $(GISDEP)
+LIBES = $(VECTORLIB) $(RASTERLIB) $(GISLIB) $(DBMILIB)
+DEPENDENCIES = $(VECTORDEP) $(RASTERDEP) $(GISDEP) $(DBMIDEP)
 EXTRA_INC = $(VECT_INC)
 EXTRA_CFLAGS = $(VECT_CFLAGS)
 

Modified: grass/trunk/raster/r.volume/main.c
===================================================================
--- grass/trunk/raster/r.volume/main.c	2013-08-10 07:20:08 UTC (rev 57440)
+++ grass/trunk/raster/r.volume/main.c	2013-08-10 16:31:26 UTC (rev 57441)
@@ -7,14 +7,15 @@
  *               Revised Jul 1995 to use new sites API (McCauley)
  *               GRASS 6 update: Hamish Bowman <hamish_b yahoo.com>
  *               Glynn Clements <glynn gclements.plus.com>, Soeren Gebbert <soeren.gebbert gmx.de>
+ *               GRASS 7 update (to use Vlib): Martin Landa <landa.martin gmail.com>
  * PURPOSE:      
  *               r.volume is a program to compute the total, and average of cell values
  *               within regions of a map defined by clumps or patches on a second map
  *               (or MASK).  It also computes the "volume" by multiplying the total
- *               within a clump by the area of each cell.  It also outputs the
- *               "centroid" location of each clump.  Output is to standard out.
+ *               within a clump by the area of each cell. It also outputs the
+ *               "centroid" location of each clump. Output is to standard out.
  *
- * COPYRIGHT:    (C) 1999-2006 by the GRASS Development Team
+ * COPYRIGHT:    (C) 1999-2006, 2013 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -26,129 +27,161 @@
 #include <string.h>
 #include <grass/gis.h>
 #include <grass/raster.h>
-#include <grass/site.h>
+#include <grass/vector.h>
+#include <grass/dbmi.h>
 #include <grass/glocale.h>
 
-int centroids(int, int *, int *, int, int);
+#include "local_proto.h"
 
 int main(int argc, char *argv[])
 {
-    /* variables   */
+    /* variables */
     DCELL *data_buf;
     CELL *clump_buf;
     CELL i, max;
+
     int row, col, rows, cols;
     int out_mode, use_MASK, *n, *e;
     long int *count;
     int fd_data, fd_clump;
-    const char *datamap, *clumpmap, *site_list;
-    const char *clump_mapset;
+
+    const char *datamap, *clumpmap, *centroidsmap;
+    
     double avg, vol, total_vol, east, north, *sum;
+
     struct Cell_head window;
-    struct Map_info *fd_sites = NULL;
-    Site *mysite;
-    Site_head site_info;
+
+    struct Map_info *fd_centroids;
+    struct line_pnts *Points;
+    struct line_cats *Cats;
+    struct field_info *Fi;
+
+    char buf[DB_SQL_MAX];
+    dbString sql;
+    dbDriver *driver;
+
     struct GModule *module;
-    struct Option *opt1, *opt2, *opt3;
-    struct Flag *flag1;
+    struct {
+        struct Option *input, *clump, *centroids, *output;
+    } opt;
+    struct {
+        struct Flag *report;
+    } flag;
 
-    /* Initialize GIS */
+    /* define paramaters and flags */
     G_gisinit(argv[0]);
 
     module = G_define_module();
     G_add_keyword(_("raster"));
     G_add_keyword(_("volume"));
-    module->description =
-	_("Calculates the volume of data \"clumps\", "
-	  "and (optionally) produces a GRASS vector points map "
-	  "containing the calculated centroids of these clumps.");
+    G_add_keyword(_("clumps"));
+    module->label =
+	_("Calculates the volume of data \"clumps\".");
+    module->description = _("Optionally produces a GRASS vector points map "
+                            "containing the calculated centroids of these clumps.");
 
-    opt1 = G_define_standard_option(G_OPT_R_INPUT);
-    opt1->description =
-	_("Existing raster map representing data that will be summed within clumps");
+    opt.input = G_define_standard_option(G_OPT_R_INPUT);
+    opt.input->description =
+	_("Name of input raster map representing data that will be summed within clumps");
 
-    opt2 = G_define_standard_option(G_OPT_R_INPUT);
-    opt2->key = "clump";
-    opt2->required = NO;
-    opt2->description =
-	_("Existing raster map, preferably the output of r.clump");
+    opt.clump = G_define_standard_option(G_OPT_R_INPUT);
+    opt.clump->key = "clump";
+    opt.clump->required = NO;
+    opt.clump->label =
+        _("Name of input clump raster map");
+    opt.clump->description = _("Preferably the output of r.clump. "
+                               "If no clump map is given than MASK is used.");
 
-    opt3 = G_define_standard_option(G_OPT_V_OUTPUT);
-    opt3->key = "centroids";
-    opt3->required = NO;
-    opt3->description = _("Vector points map to contain clump centroids");
+    opt.centroids = G_define_standard_option(G_OPT_V_OUTPUT);
+    opt.centroids->key = "centroids";
+    opt.centroids->required = NO;
+    opt.centroids->description = _("Name for output vector points map to contain clump centroids");
 
-    flag1 = G_define_flag();
-    flag1->key = 'f';
-    flag1->description = _("Generate unformatted report");
+    opt.output = G_define_standard_option(G_OPT_F_OUTPUT);
+    opt.output->required = NO;
+    opt.output->label =
+	_("Name for output file to hold the report");
+    opt.output->description =
+	_("If no output file given report is printed to standard output");
 
+    flag.report = G_define_flag();
+    flag.report->key = 'f';
+    flag.report->description = _("Generate unformatted report (items separated by colon)");
+
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    /* get current window */
-    G_get_window(&window);
-
-    /* initialize */
-    out_mode = 1;		/* assume full output text */
-    mysite = G_site_new_struct(CELL_TYPE, 2, 0, 4);
-
     /* get arguments */
-    datamap = opt1->answer;
+    datamap = opt.input->answer;
+    
+    clumpmap = NULL;
+    if (opt.clump->answer)
+	clumpmap = opt.clump->answer;
+    
+    centroidsmap = NULL;
+    fd_centroids = NULL;
+    Points = NULL;
+    Cats = NULL;
+    driver = NULL;
+    if (opt.centroids->answer) {
+	centroidsmap = opt.centroids->answer;
+        fd_centroids = G_malloc(sizeof(struct Map_info));
+    }
+    
+    out_mode = (!flag.report->answer);
 
-    if (opt2->answer)
-	clumpmap = opt2->answer;
-    else
-	clumpmap = "";
-
-    if (opt3->answer)
-	site_list = opt3->answer;
-    else
-	site_list = "";
-
-    out_mode = (!flag1->answer);
-
-    if (*datamap == 0)
-	G_fatal_error(_("No data map specified"));
-
     /*
-     * See if MASK or a separate "clumpmap" layer is to be used-- it must(!)
-     * be one of those two choices.
+     * see if MASK or a separate "clumpmap" raster map is to be used
+     * -- it must(!) be one of those two choices.
      */
     use_MASK = 0;
-    if (*clumpmap == '\0') {
+    if (!clumpmap) {
 	clumpmap = "MASK";
 	use_MASK = 1;
+        if (!G_find_raster2(clumpmap, G_mapset()))
+            G_fatal_error(_("No MASK found. If no clump map is given than the MASK is required. "
+                            "You need to define a clump raster map or create a MASK by r.mask command."));
+        G_important_message(_("No clump map given, using MASK"));
     }
+    
+    /* open input and clump raster maps */
     fd_data = Rast_open_old(datamap, "");
-    if (use_MASK)
-	clump_mapset = G_mapset();
-    else
-	clump_mapset = "";
-
-    fd_clump = Rast_open_old(clumpmap, clump_mapset);
-
-    /* initialize sites file (for centroids) if needed */
-    if (*site_list) {
-	fd_sites = G_fopen_sites_new(site_list);
-	if (fd_sites == NULL)
-	    G_fatal_error(_("Unable to open centroids vector points map"));
+    fd_clump = Rast_open_old(clumpmap, use_MASK ? G_mapset() : "");
+    
+    /* initialize vector map (for centroids) if needed */
+    if (centroidsmap) {
+	Vect_open_new(fd_centroids, centroidsmap, WITHOUT_Z);
+        
+        Points = Vect_new_line_struct();
+        Cats = Vect_new_cats_struct();
+        
+        /* initialize data structures */
+        Vect_append_point(Points, 0., 0., 0.);
+        Vect_cat_set(Cats, 1, 1);
     }
+    
+    /* initialize output file */
+    if (opt.output->answer && strcmp(opt.output->answer, "-") != 0) {
+	if (freopen(opt.output->answer, "w", stdout) == NULL) {
+	    perror(opt.output->answer);
+	    exit(EXIT_FAILURE);
+	}
+    }
 
     /* initialize data accumulation arrays */
-    max = Rast_get_max_c_cat(clumpmap, clump_mapset);
+    max = Rast_get_max_c_cat(clumpmap, use_MASK ? G_mapset() : "");
 
     sum = (double *)G_malloc((max + 1) * sizeof(double));
     count = (long int *)G_malloc((max + 1) * sizeof(long int));
 
-    for (i = 0; i <= max; i++) {
-	sum[i] = 0;
-	count[i] = 0;
-    }
-
+    G_zero(sum, (max + 1) * sizeof(double));
+    G_zero(count, (max + 1) * sizeof(long int));
+    
     data_buf = Rast_allocate_d_buf();
     clump_buf = Rast_allocate_c_buf();
-
+    
     /* get window size */
+    G_get_window(&window);
     rows = window.rows;
     cols = window.cols;
 
@@ -160,19 +193,23 @@
 	for (col = 0; col < cols; col++) {
 	    i = clump_buf[col];
 	    if (i > max)
-		G_fatal_error(
-		    "Row=%d Col=%d Cat=%d in clump map [%s]; max=%d.\n"
-		    "Cat value > max returned by Rast_get_max_c_cat.",
-		    row, col, i, clumpmap, max);
-	    if (i < 1)
+		G_fatal_error(_("Invalid category value %d (max=%d): row=%d col=%d"),
+                              i, max, row, col);
+	    if (i < 1) {
+                G_debug(3, "row=%d col=%d: zero or negs ignored", row, col);
 		continue;	/* ignore zeros and negs */
-	    if (Rast_is_d_null_value(&data_buf[col]))
+            }
+	    if (Rast_is_d_null_value(&data_buf[col])) {
+                G_debug(3, "row=%d col=%d: NULL ignored", row, col);
 		continue;
+            }
+            
 	    sum[i] += data_buf[col];
 	    count[i]++;
 	}
     }
-    G_percent(row, rows, 2);
+    G_percent(1, 1, 1);
+    
     /* free some buffer space */
     G_free(data_buf);
     G_free(clump_buf);
@@ -183,32 +220,59 @@
 
     i = centroids(fd_clump, e, n, 1, max);
 
+    /* close raster maps */
+    Rast_close(fd_data);
+    Rast_close(fd_clump);
+    
     /* got everything, now do output */
-    if (*site_list) {
-	/* FIXME: convert to modern vector points map metadata */
-	char desc[GNAME_MAX * 2 + 40];
+    if (centroidsmap) {
+        G_message(_("Creating vector point map <%s>..."), centroidsmap);
+        /* set comment */
+	sprintf(buf, _("From '%s' on raster map <%s> using clumps from <%s>"),
+                argv[0], datamap, clumpmap);
+        Vect_set_comment(fd_centroids, buf);
 
-	site_info.form = NULL;
-	site_info.time = NULL;
-	site_info.stime = NULL;
-	sprintf(desc, "from %s on map %s using clumps from %s",
-		argv[0], datamap, clumpmap);
-	site_info.desc = G_store(desc);
-	site_info.name = G_store(site_list);
-	site_info.labels =
-	    G_store("centroid east|centroid north|#cat vol avg t n");
-	G_site_put_head(fd_sites, &site_info);
+        /* create attribute table */        
+        Fi = Vect_default_field_info(fd_centroids, 1, NULL, GV_1TABLE);
+        
+        driver = db_start_driver_open_database(Fi->driver,
+                                               Vect_subst_var(Fi->database, fd_centroids));
+	if (driver == NULL) {
+	    G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
+			  Vect_subst_var(Fi->database, fd_centroids), Fi->driver);
+	}
+        db_set_error_handler_driver(driver);
+        
+	db_begin_transaction(driver);
+        
+        db_init_string(&sql);
+	sprintf(buf, "create table %s (cat integer, volume double precision, "
+                "average double precision, sum double precision, count integer)",
+                Fi->table);
+	db_set_string(&sql, buf);
+	Vect_map_add_dblink(fd_centroids, 1, NULL, Fi->table, GV_KEY_COLUMN, Fi->database,
+			    Fi->driver);
+
+	G_debug(3, "%s", db_get_string(&sql));
+	if (db_execute_immediate(driver, &sql) != DB_OK) {
+	    G_fatal_error(_("Unable to create table: %s"), db_get_string(&sql));
+	}
     }
+
+    /* print header */
     if (out_mode) {
-	fprintf(stdout, "Volume report on data from %s", datamap);
-	fprintf(stdout, " using clumps on %s map\n\n", clumpmap);
+	fprintf(stdout, _("\nVolume report on data from <%s> using clumps on <%s> raster map"),
+                datamap, clumpmap);
+        fprintf(stdout, "\n\n");
 	fprintf(stdout,
-		" Cat    Average   Data   # Cells        Centroid             Total\n");
+		_("Category   Average   Data   # Cells        Centroid             Total\n"));
 	fprintf(stdout,
-		"Number  in clump  Total  in clump   Easting   Northing       Volume\n\n");
+		_("Number     in clump  Total  in clump   Easting     Northing     Volume"));
+        fprintf(stdout, "\n%s\n", SEP);
     }
     total_vol = 0.0;
 
+    /* print output, write centroids */
     for (i = 1; i <= max; i++) {
 	if (count[i]) {
 	    avg = sum[i] / (double)count[i];
@@ -216,29 +280,42 @@
 	    total_vol += vol;
 	    east = window.west + (e[i] + 0.5) * window.ew_res;
 	    north = window.north - (n[i] + 0.5) * window.ns_res;
-	    if (*site_list) {
-		mysite->east = east;
-		mysite->north = north;
-		mysite->ccat = i;
-		mysite->dbl_att[0] = vol;
-		mysite->dbl_att[1] = avg;
-		mysite->dbl_att[2] = sum[i];
-		mysite->dbl_att[3] = (double)count[i];
-		/*       "%-1.2f|%-1.2f|#%5d v=%-1.2f a=%-1.2f t=%-1.0f n=%ld\n", */
-		/* east, north, i, vol, avg, sum[i], count[i]); */
-		G_site_put(fd_sites, mysite);
+	    if (fd_centroids) { /* write centroids if requested */
+                Points->x[0] = east;
+                Points->y[0] = north;
+                Cats->cat[0] = i;
+                Vect_write_line(fd_centroids, GV_POINT, Points, Cats);
+	
+                sprintf(buf, "insert into %s values (%d, %f, %f, %f, %ld)",
+                        Fi->table, i, vol, avg, sum[i], count[i]);
+                db_set_string(&sql, buf);
+
+                if (db_execute_immediate(driver, &sql) != DB_OK)
+                    G_fatal_error(_("Cannot insert new row: %s"),
+                                  db_get_string(&sql));
 	    }
 	    if (out_mode)
 		fprintf(stdout,
-			"%5d%10.2f%10.0f %7ld  %10.2f  %10.2f %16.2f\n", i,
+			"%8d%10.2f%10.0f %7ld  %10.2f  %10.2f %16.2f\n", i,
 			avg, sum[i], count[i], east, north, vol);
 	    else
 		fprintf(stdout, "%d:%.2f:%.0f:%ld:%.2f:%.2f:%.2f\n",
 			i, avg, sum[i], count[i], east, north, vol);
 	}
     }
-    if (total_vol > 0.0 && out_mode)
-	fprintf(stdout, "%58s %14.2f", "Total Volume =", total_vol);
-    fprintf(stdout, "\n");
+
+    /* write centroid attributes and close the map*/
+    if (fd_centroids) {
+        db_commit_transaction(driver);
+        Vect_close(fd_centroids);
+    }
+    
+    /* print total value */
+    if (total_vol > 0.0 && out_mode) {
+        fprintf(stdout, "%s\n", SEP);
+	fprintf(stdout, "%60s = %14.2f", _("Total Volume"), total_vol);
+        fprintf(stdout, "\n");
+    }
+
     exit(EXIT_SUCCESS);
-}				/* end of main() */
+} 

Modified: grass/trunk/raster/r.volume/r.volume.html
===================================================================
--- grass/trunk/raster/r.volume/r.volume.html	2013-08-10 07:20:08 UTC (rev 57440)
+++ grass/trunk/raster/r.volume/r.volume.html	2013-08-10 16:31:26 UTC (rev 57441)
@@ -1,99 +1,122 @@
 <h2>DESCRIPTION</h2>
 
-<em>r.volume</em> is a tool for summing cell values within clumps 
-and calculating volumes and centroids of patches or clumps.
-<p><em>r.volume</em> generates a table containing the sum of all cells from
-a data_map layer sorted by category on a clump map, and optionally
-generates a vector points map of the centroids for each clump.  If a
-clump map is not specified, the current MASK is used.
-The sum is multiplied by the area of a cell to give the volume
-occupied by that cell.  See below for an example of the output
-table. 
+<em>r.volume</em> is a tool for summing cell values within clumps and
+calculating volumes and centroids of patches or clumps.
 
-<!-- The table is placed in the user's home directory in the
-file Gvol.report. (or not???)
+<p>
+<em>r.volume</em> generates a table containing the sum of all cells
+from a <b>input</b> raster map sorted by category on a <b>clump</b>
+raster map, and optionally generates a vector points map of the
+centroids for each clump.  If a clump map is not specified, the
+current MASK is used. The MASK can be defined
+by <em><a href="r.mask.html">r.mask</a></em>. The sum is multiplied by
+the area of a cell to give the volume occupied by that cell. See below
+for an example of the output table.
 
-NOTE: I can't find any evidence of this in the source code, and I have tested 
-the module out as of Jan 10, 2008. I'll leave the above comment about
-automatic report generation commented out from the manpage for now, unless I get 
-notification otherwise. - EP
--->
+<!-- The table is placed in the user's home directory in the file
+Gvol.report. (or not???)
 
+NOTE: I can't find any evidence of this in the source code, and I have
+tested the module out as of Jan 10, 2008. I'll leave the above comment
+about automatic report generation commented out from the manpage for
+now, unless I get notification otherwise. - EP -->
+
 <h2>NOTES</h2>
-<p>If a clump map is not given and a MASK not set, the program exits
-with an error message.
-<p><em>r.volume</em> works in the current region and respects the current MASK.
+
 <p>
-<h2>EXAMPLE</h2>
+If a clump map is not given and a MASK not set, the program exits with
+an error message.
 
-The following report was generated by the command:
-(spearfish data base; fields.only is the fields layer without the
-National Forest category)
-<p>r.volume data=elevation clump=fields.only centroids=field.centers 
 <p>
-<pre><tt>
-Volume report on data from elevation using clumps on fields.only map
+<em>r.volume</em> works in the current region and respects the current
+MASK.
 
- Cat    Average   Data   # Cells        Centroid             Total
-Number  in clump  Total  in clump   Easting   Northing       Volume
+<h3>CENTROIDS</h3>
 
-    1   1181.09   75590      64   595500.00  4927700.00   755900000.00
-    2   1163.50   69810      60   597100.00  4927700.00   698100000.00
-    3   1146.83   34405      30   598300.00  4927700.00   344050000.00
-    4   1193.20  366311     307   599400.00  4927300.00  3663110000.00
-        .....
-        .....   
-        .....
-   60   1260.08  351563     279   603100.00  4921000.00  3515630000.00
-   61   1213.93   35204      29   603700.00  4921500.00   352040000.00
-   62   1207.71   33816      28   604100.00  4921500.00   338160000.00
-                                         Total Volume = 67226740000.00
-</tt></pre>
+The centroid coordinates are the same as those stored in the vector
+map (if one was requested by <b>centroids</b> parameter). They are
+guaranteed to fall on a cell of the appropriate category, thus they
+are not always the true, mathematical centroid. They will always fall
+at a cell center.
 
-
-The Data Total column is the sum of the elevations for each
-in each of the fields.  The Total Volume is the sum multiplied
-by the e-w resolution times the n-s resolution.  Note that
-the units on the volume may be difficult if the units of cell
-values on the data_map layer and the resolution units differ.
 <p>
-<h3>CENTROIDS</h3>
-The centroid coordinates are the same as those stored in the sites
-file (if one was requested).  They are guaranteed to fall on a cell
-of the appropriate category, thus they are not always the true,
-mathematical centroid.  They will always fall at a cell center.
+Attribute table linked to the vector map with centroids contains several columns:
 
-<h3>FORMAT OF CENTROIDS table<br></h3>
-For each line of above table the vector points table contains
-these columns:
-<tt>
-easting,
-northing,
-cat,
-volume,
-average,
-sum,
-count
-</tt>
-<p>This can be converted directly to a raster map with each point
-a separate category using <em>v.to.rast</em>.
+<ul>
+  <li><tt>cat</tt> - category value (integer)</li>
+  <li><tt>volume</tt> - volume value (double precision)</li>
+  <li><tt>average</tt> - average value in the clump (double precision)</li>
+  <li><tt>sum</tt> - sum of cell values in the clump (double precision)</li>
+  <li><tt>count</tt> - number of cells with the category (integer)</li>
+</ul>
+
 <p>
-<!-- As far as I can tell, no attributes are written to a table in Grass 6.3
-(Jan 2008), as this program hasn't been updated to use the Grass 6 vector library. - EP
--->
+Vector points can be converted directly to a raster map with each
+point a separate category
+using <em><a href="v.to.rast.html">v.to.rast</a></em>.
 
-
 <h3>APPLICATIONS</h3>
-By preprocessing the elevation layer with <em>r.mapcalc</em> and using
-suitable masking or clump maps, very interesting applications can
-be done with <em>r.volume</em>.  Such as, calculating the volume of rock
-in a potential quarry; calculating cut/fill volumes for roads;
-finding water volumes in potential reservoirs.  Data layers of
-other measures of real values.
 
-<h2>AUTHOR</h2>
-Dr. James Hinthorne, Central Washington University GIS Laboratory<br>
-December 1988.
+By preprocessing the elevation raster map
+with <em><a href="r.mapcalc.html">r.mapcalc</a></em> and using
+suitable masking or clump maps, very interesting applications can be
+done with <em>r.volume</em>.  Such as, calculating the volume of rock
+in a potential quarry; calculating cut/fill volumes for roads; finding
+water volumes in potential reservoirs. 
 
+<h2>EXAMPLE</h2>
 
+The following report was generated by the command (North Carolina dataset):
 
+<div class="code"><pre>
+# set computational region
+g.region rast=elevation
+
+# compute volume
+r.volume input=elevation clump=geology_30m
+
+Volume report on data from <elevation> using clumps on <geology_30m> raster map
+
+Category   Average   Data   # Cells        Centroid             Total
+Number     in clump  Total  in clump   Easting     Northing     Volume
+-----------------------------------------------------------------------------
+     217    118.93  86288828  725562   635325.00   221535.00    8628882798.63
+     262    108.97  21650560  198684   638935.00   222495.00    2165056037.02
+     270     92.23  63578874  689373   642405.00   221485.00    6357887443.53
+     405    132.96  33732662  253710   631835.00   224095.00    3373266208.59
+     583    139.35   3011288   21609   630205.00   224665.00     301128821.55
+     720    124.30    599618    4824   634075.00   227995.00      59961816.06
+     766    132.43    936791    7074   631425.00   227845.00      93679120.08
+     862    118.31   7302317   61722   630505.00   218885.00     730231746.74
+     910     94.20   4235816   44964   639215.00   216365.00     423581613.11
+     921    135.22   1693985   12528   630755.00   215445.00     169398523.05
+     945    127.24      1145       9   630015.00   215015.00        114512.03
+     946     89.91    365748    4068   639085.00   215255.00      36574833.85
+     948    129.02    112632     873   630185.00   215115.00      11263181.57
+-----------------------------------------------------------------------------
+                                                Total Volume = 22351026655.81
+</pre></div>
+
+The <tt>Data Total</tt> column is the sum of the elevations for each
+in each of the fields.  The <tt>Total Volume</tt> is the sum
+multiplied by the east-west resolution times the north-south
+resolution. Note that the units on the volume may be difficult if the
+units of cell values on the <b>input</b> raster map and the resolution
+units differ.
+
+<h2>SEE ALSO</h2>
+
+<em>
+  <a href="r.clump.html">r.clump</a>,
+  <a href="r.mask.html">r.mask</a>,
+  <a href="r.mapcalc.html">r.mapcalc</a>
+</em>
+
+<h2>AUTHORS</h2>
+
+Dr. James Hinthorne, Central Washington University GIS Laboratory,
+December 1988.<br>
+Updated to GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic
+
+<p>
+<i>Last changed: $Date$</i>



More information about the grass-commit mailing list