No subject

Net.Noise owner news at max.cecer.army.mil
Sat Mar 6 23:47:07 EST 1993


Newsgroups: info.grass.user
Path: zorro.cecer.army.mil!shapiro
From: shapiro at zorro.cecer.army.mil (Michael Shapiro)
Subject: Re: r.combine
Message-ID: <C3I5AI.8w0 at news.cecer.army.mil>
Sender: news at news.cecer.army.mil (Net.Noise owner)
Organization: US Army Corps of Engineers Construction Engineering Research Labs
References: <199302231826.AA16642 at zorro.cecer.army.mil>
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.
eg
	0:20
	0:30
	10:0
	10:1
	20:0
	20:1

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