[GRASSLIST:928] RE: Basic volume calculation question
Patton, Eric
epatton at nrcan.gc.ca
Thu Apr 27 09:03:32 EDT 2006
Thanks for that nice overview. I tried using r.volume with a mask in place,
as in your example. Here's how I created the mask:
r.info -r Diff_Nov1998_May1998_5m # This map is a surface difference;
min=-2.400000 # accumulation is between 0 and 1.65
max=1.650000
r.info -t Diff_Nov1998_May1998_5m # Yes, we are dealing with float data
datatype=FCELL
r.mapcalc MASK = 'if(Diff_Nov1998_May1998_5m > 0, Diff_Nov1998_May1998_5m,
null())'
100%
[Raster MASK present]
But now if I run d.rast.num on Diff_Nov1998_May1998_5m with the mask in
place, the only cell values displayed are those that are greater than 0.5m;
all values between 0 and 0.5 have been masked out. So if I continued on with
r.volume, won't the total accumulation get underestimted?
See attached images; note in the top left corner of the before-masking image
there are a lot of values between 0-0.5m; in the after-masking image, these
values are missing with the mask in place.
I also tried converting my difference map to double using the double()
function in r.mapcalc, with the same results that values between 0-0.5m get
eaten in the mask.
~ Eric.
-----Original Message-----
From: Hamish
To: Patton, Eric
Cc: GRASSLIST at baylor.edu
Sent: 4/27/2006 1:42 AM
Subject: Re: [GRASSLIST:902] Basic volume calculation question
> 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]
More information about the grass-user
mailing list