[GRASSLIST:932] RE: Basic volume calculation question

Wolf Bergenheim wolf+grass at bergenheim.net
Thu Apr 27 10:33:34 EDT 2006


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