[GRASSLIST:940] RE: Basic volume calculation question
Patton, Eric
epatton at nrcan.gc.ca
Thu Apr 27 12:28:01 EDT 2006
Hm, I've been experimenting with r.volume's output on small datasets
consisting of only a few pixels. It looks like r.volume calculates the
average z-value of the raster first, then multiplies this by nsres and ewres
to get the volume. Why doesn't it just multiply the z-value of each pixel by
the pixel's area?
~ Eric.
-----Original Message-----
From: owner-GRASSLIST at baylor.edu
To: 'Wolf Bergenheim '
Cc: ''GRASS Users ' '
Sent: 4/27/2006 12:00 PM
Subject: [GRASSLIST:938] RE: Basic volume calculation question
Thanks that worked great, Wolf!
~ Eric.
-----Original Message-----
From: Wolf Bergenheim
To: Patton, Eric
Cc: 'Wolf Bergenheim '; 'GRASS Users '
Sent: 4/27/2006 10:33 AM
Subject: RE: [GRASSLIST:928] RE: Basic volume calculation question
On Thu, 27 Apr 2006, Patton, Eric wrote:
> Thanks for that idea, Wolf. I just tried it using > 0.0 as the test
case,
> with the same results. It does seem like some kind of integer rounding
is
> going on.
>
> Can anyone comment on the datatype output from an if(x,a,b) statement
in
> r.mapcalc when input maps are type float?
>
In your case it returns the value Diff_Nov1998_May1998_5m, but since you
are making a MASK it should probably just return 1, right? Since masks
are
treated as integers I'm guessing that this is where the rounding
happens.
Your spell would be:
> r.mapcalc MASK = 'if(Diff_Nov1998_May1998_5m > 0.0, 1, null())'
--Wolf
--
<:3 )---- Wolf Bergenheim ----( 8:>
More information about the grass-user
mailing list