No subject

Net.Noise owner news at
Sat Mar 6 23:47:07 EST 1993

Newsgroups: info.grass.user
From: shapiro at (Michael Shapiro)
Subject: Re: r.combine
Message-ID: <C3I5AI.8w0 at>
Sender: news at (Net.Noise owner)
Organization: US Army Corps of Engineers Construction Engineering Research Labs
References: <199302231826.AA16642 at>
Date: Sun, 7 Mar 1993 04:47:06 GMT
Lines: 30

>Bill Albert writes:

>#I want to overlay two maps where each cell reatins its value where there
>#is no intersection with the other map. Where there is an intersection
>#a new value is created. The "OR" operator doesn't work for this. The
>#"OVER" operator seems to be restricted to four colors. Also, what about
>#finding what the values were for each cell that intersected?

The key tools are r.stats, awk, and r.mapcalc:
	r.stats map1,map2
will output all unique combinations of values in the two layers.

If you write the awk script to output r.mapcalc rules
which preserve the original value from map1 where map2 is zero
and vice verse (from map2 where map1 is zero) then what you have
to do is keep track of the max value from these case and renumber
all the other combinations starting with max+1. It may run slowly
(since the awk script will generate a lot of input for r.mapcalc).

Michael Shapiro U.S. Army CERL
Environmental Division       

More information about the grass-user mailing list