cat file for r.mapcalc

I have two layers: left and right. They don't overlay.
I'd like to merge them together. Guess I can use
either
  new = left + right
or more safely
  new=if(left,left,right)

However, there won't be category contents for Layer "new".
Is there a way to bring category contents in Layers "left"
and "right" into Layer "new"?
Or maybe I should use another function?

Appreciate any hint and help.

zhuang@access.digex.net

On 13 Oct 1995, Xin Zhuang wrote:

I have two layers: left and right. They don't overlay.
I'd like to merge them together. Guess I can use
either
  new = left + right
or more safely
  new=if(left,left,right)

However, there won't be category contents for Layer "new".
Is there a way to bring category contents in Layers "left"
and "right" into Layer "new"?
Or maybe I should use another function?

Appreciate any hint and help.

I believe that r.patch will retain category labels as long as they are
unique; it _does_ retain colors for unique categories. Check it out!
---
Malcolm D. Williamson - GIS Specialist E-mail: malcolm@cast.uark.edu
Center for Advanced Spatial Technologies Telephone: (501) 575-6159
Ozark Rm. 12 Fax: (501) 575-5218
University of Arkansas
Fayetteville, AR 72701

Hi Xin,
  You can use r.patch instead. As long as the input layers are labelled, r.patch
will bring the labels into the new layer. Rick

On 13 Oct 1995, Xin Zhuang wrote:

I have two layers: left and right. They don't overlay.
I'd like to merge them together. Guess I can use
either
  new = left + right
or more safely
  new=if(left,left,right)

However, there won't be category contents for Layer "new".
Is there a way to bring category contents in Layers "left"
and "right" into Layer "new"?
Or maybe I should use another function?

Appreciate any hint and help.

zhuang@access.digex.net

------------------------------------------------------------------------
Rick Thompson- Research Specialist E-mail: rick@cast.uark.edu
Center for Advanced Spatial Technologies Telephone: (501) 575-8498
Ozark Hall Rm. 12 Fax: (501) 575-5218
University of Arkansas
Fayetteville, AR 72701
DISCLAIMER: Any opinions or comments about any product, organization,
            or individual expressed in the above text are my own.

I tried with r.patch and found out r.patch mislabel the cats.
I was trying to merge block layers from two counties.
Somehow r.patch assigned some cats crossing counties.
Maybe a bug in r.patch?

I modified r.cross with fs (not reruied). The original
r.cross uses semicolon (:wink: to separate cats from
dirrerent layers. With fs, you can have many other choices.
Here's syntax
  r.cross input=[files....] output=file fs=[character|SPACE|semicolon]

I enclosed a patch at the end of this message.

--Xin

=======
begin 600 patch.cross.tar
M<&%T8V@N8V%T<P``````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````"`@(#8V-"``("`@,S$Q(``@("`@-C(@`"`@("`@("`@,S,R
M("`V,#0P-3`T,C0P("`@-C`R-P`@````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````S8S,*/"!S971?8V%T("AR97-U;'0L(&-A="P@
M<&-A=',L(&9S*0HM+2T*/B!S971?8V%T("AR97-U;'0L(&-A="P@<&-A=',I
M"C=D-@H\("`@("!C:&%R("IF<SL*,CDL,S-C,C@*/"`):68@*"!I("8F(&9S
M("D@"CP@"7L@"CP@"2`@<W1R8V%T("AB=68L(&9S*3L@"CP@"2`@<W1R8V%T
M("AB=68L(")<,"(I.R`*/"`)?0HM+2T*/B`):68@*&DI('-T<F-A="`H8G5F
M+"`B.R`B*3L@"@``````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````'!A=&-H+FUA:6X`
M````````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````@
M("`V-C0@`"`@(#,Q,2``("`@(#8R(``@("`@("`@,30V,B`@-C`T,#4P-#(W
M,B`@(#8P-3,`(```````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````-2PV9#0*/"!S=&%T:6,@9G,])UPP)SL*/"`*,35D,3(*/"`@("`@
M<W1A=&EC(&-H87(@9G,["C,P8S(W"CP@"7-T<G5C="!/<'1I;VX@*FEN<'5T
M+"`J;W5T<'5T+"`J9G,["BTM+0H^(`ES=')U8W0@3W!T:6]N("II;G!U="P@
M*F]U='!U=#L*-3<L-C-D-3,*/"`@("`@<&%R;2YF<R`]($=?9&5F:6YE7V]P
M=&EO;B@I(#L*/"`@("`@<&%R;2YF<RT^:V5Y("`@("`@("`](")F<R(["CP@
M("`@('!A<FTN9G,M/FME>5]D97-C("`@/2`B8VAA<F%C=&5R?'-P86-E.G-E
M;6EC;VQO;B(["CP@("`@('!A<FTN9G,M/G1Y<&4@("`@("`@/2!465!%7U-4
M4DE.1SL*/"`@("`@<&%R;2YF<RT^<F5Q=6ER960@("`]($Y/.PH\("`@("!P
M87)M+F9S+3YD97-C<FEP=&EO;CT@(D]U='!U="!S97!A<F%T;W(@8VAA<F%C
M=&5R("AD969A=6QT.B!N;W1H:6YG*2(["CP@"C<W+#@V9#8V"CP@("`@:68@
M*'!A<FTN9G,M/F%N<W=E<B`A/2!.54Q,*0H\("`@("!["CP@("`@("`@("!I
M9B`H<W1R8VUP*'!A<FTN9G,M/F%N<W=E<BP@(G-P86-E(BD@/3T@,"D*/"`@
M("`@("`@("`@("!F<R`]("<@)SL*/"`@("`@("`@(&5L<V4@:68@*'-T<F-M
M<"AP87)M+F9S+3YA;G-W97(L(")S96UI8V]L;VXB*2`]/2`P*0H\("`@("`@
M("`@("`@(&9S(#T@)SLG.PH\("`@("`@("`@96QS90H\("`@("`@("`@("`@
M(&9S/2!P87)M+F9S+3YA;G-W97);,%T["CP@("`@('T*/"`*,3@P8S$V,`H\
M(`ES971?8V%T("AN8V%T<RP@<F5C;&%S<UMN8V%T<UTN8V%T+"`F<&-A=',L
M("9F<RD["BTM+0H^(`ES971?8V%T("AN8V%T<RP@<F5C;&%S<UMN8V%T<UTN
M8V%T+"`F<&-A=',I.PH`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
=````````````````````````````````````````
`
end