XOR on layers

Xin Zhuang zhuang at access.digex.net
Mon Jun 14 17:23:58 EDT 1993

An alternative:

	r.mapcalc temp=if(b,a,0)
/* keep a if b > 0; otherwise assign 0 (which means
"no-data" in a will be still "no-data" in temp) */

	r.mapcalc result=a-temp
/* minus ZERO doesn't change anything. but the overlapped
area between a and b is 0 ("no-data") now. */

--Xin Zhuang
zhuang at access.digex.com

More information about the grass-user mailing list