[GRASSLIST:5441] Re: patching 2 colored maps

Glynn Clements glynn at gclements.plus.com
Wed Jan 19 13:12:18 EST 2005


ivan marchesini wrote:

> I have two 8 bit colored maps that I have to patch together...
> so I use :
> 
> v.patch input=map1,map2 output=map3
> 
> the problem is that in the resultant map3 only the first map is correcly
> patched... the other one soffers of some kind of alteration of the
> transparency and of the colours... so the patched map is unuseful!!!!
> 
> did you have some similar problem?? how do you solve it???

I suspect that the two maps have different colour tables, i.e. they
use different categories to represent any given colour.

If you don't care about the categories, only the colours, I suggest
converting both to composite maps using something like:

	r.mapcalc 'tmp.r = r#oldmap ; tmp.g = g#oldmap ; tmp.b = b#oldmap'
	r.composite r=tmp.r g=tmp.g b=tmp.b out=newmap
	g.remove rast=tmp.r,tmp.g,tmp.b

then patching the resulting maps together.

If you do care about the categories, you will need to manually
remap the categories using r.reclass so that both maps use the same
category scheme.

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




More information about the grass-user mailing list