[GRASS-user] r3.mapcalc / r.mapcalc: Logical Operators &&, || behave differently

Glynn Clements glynn at gclements.plus.com
Thu Aug 21 08:16:41 PDT 2014


"Peter Löwe" wrote:

> Yet still I'm puzzled, as I hoped that type casting to INT would do the trick:
> 
> r3.mapcalc l01i='int(l01)'
> r3.mapcalc l02i='int(l02)'

It appears that 3D volumes are always floating-point.

So you would need to use e.g.

	r3.mapcalc "FOO3 = if((int(l01) || int(l02)),42,null())"
or
	r3.mapcalc "FOO3 = if((l01 != 0 || l02 != 0),42,null())"

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list