[GRASSLIST:921] Re: Basic volume calculation question

Hamish hamish_nospam at yahoo.com
Thu Apr 27 01:42:53 EDT 2006


> I have a raster which represents the differenced surface from two
> consecutive surveys over a marine disposal site. It is estimated that about
> 50,000m3 of harbour dredge was disposed of at the site between surveys. I
> have further mapcalc'd the difference map so only values greater than 0 are
> shown. What is the best approach to calculate the volume of the surface
> difference? 
> 
> r.volume seems to want a clump-map from r.clump as input....but I'm not
> interested in aggregating common raster categories together, I just want to
> tally the volume of all the positive, non-null cells in the differenced map.

You don't need a clump map if you have a MASK map set.

Spearfish example:

GRASS> r.mapcalc MASK='if(fields==44)'
[Raster MASK present]
GRASS> r.volume data=elevation.10m
Complete ... 100%
Volume report on data from elevation.10m using clumps on MASK map

 Cat    Average   Data   # Cells        Centroid             Total
Number  in clump  Total  in clump   Easting   Northing       Volume

    1   1198.84  23976857   20000   600355.00  4922865.00    2397685700.00
                                            Total Volume =  2,397,685,700.00
[Raster MASK present]

 
> Which program to use: r.stats/r.statistics/r.report/r.sum/r.volume.....

by hand:
(assumes 2D map)

- MASK off area of interest,
- use r.univar to get sum of cells in "n" number of data cells.
- take sum/n (or just mean)
- subtract any datum level (say min from r.univar)
- multiply by area: n*(ewres()+nsres())/2    "g.region -m"
-> answer.

e.g. for same Spearfish dataset, field #44 + elevation.10m

mean height above lowest value is 25.71m. res is 10m, n=20000

volume= (n*10m^2) * 25.71m = 51,420,000 m^3.

If you add in the extra volume (0-min height) you get the same answer.


!!! actually not exactly. for this example r.univar gives a mean of
1198.85 while r.volume reports a mean of 1198.84.   ?????!!


r3.* modules may have another way.


Hamish




More information about the grass-user mailing list