Hi Andrew,
with latest release (241031) lascopy64 got 2 new arguments:
-copy_rgb : copy rgb to target (64bit only)
-copy_user_data : copy user data to target (64bit only)
This helps to simplify your task.
Please see this example:
This are our testfiles. We want to copy the RGB of "file A" into Extrabytes (Attributes) of "file B".
file A file B
x y z R G B x y z R G B
1 1 1 55 66 77 1 1 1 88 99 00
2 3 4 66 77 88 2 3 4 11 22 33
:: first we create your testfiles out of the textfiles
txt2las64 -i fileA.txt -o fileA.laz -set_scale 1 1 1
LAStools txt2las (by
in...@rapidlasso.de) version 241031
Column description detected. Parse string is xyzRGB
opening reader took 0 sec.
reading from 'fileA.txt' and writing to 'fileA.laz'
main pass took 0.001 sec.
done with 'fileA.laz'. total time 0.001 sec.
txt2las64 -i fileB.txt -o fileB.laz -set_scale 1 1 1
:: then we extend one file with the attribs we want to have
las2las64 -i fileA.laz -o fileAa.laz -add_attribute 1 R Red -add_attribute 1 G Green -add_attribute 1 B Blue
lasinfo64 -i fileAa.laz
...
Extra Byte Descriptions
data type: 1 (unsigned char), name "R", description: "Red", scale: 1 (not set), offset: 0 (not set)
data type: 1 (unsigned char), name "G", description: "Green", scale: 1 (not set), offset: 0 (not set)
data type: 1 (unsigned char), name "B", description: "Blue", scale: 1 (not set), offset: 0 (not set)
...
:: now we copy the RGB values of our file into the attributes
las2las64 -i fileAa.laz -o fileAb.laz ^
-copy_R_into_register 0 -copy_G_into_register 1 -copy_B_into_register 2 ^
-copy_register_into_attribute 0 0 -copy_register_into_attribute 1 1 -copy_register_into_attribute 2 2
lasinfo64 -i fileAb.laz
Color R 55 66
G 66 77
B 77 88
attribute0 55 66 ('R')
attribute1 66 77 ('G')
attribute2 77 88 ('B')
:: finally we do the lascopy task to copy the RGB values of "file B" into our new file
:: we do this unmatched - just by order, of course this should work with -match_.... arguments as well
lascopy64 -i fileB.laz -i fileAb.laz -o fileC.laz -unmatched -copy_rgb
lasinfo64 -i fileC.laz
Color R 11 88
G 22 99
B 0 33
attribute0 55 66 ('R')
attribute1 66 77 ('G')
attribute2 77 88 ('B')
:: final test: export the values to text to view the results
las2txt64 -i fileC.laz -o fileC.txt -parse xyzRGB012 -coldesc
x y z R G B 0 1 2
1 1 1 88 99 0 55 66 77
2 3 4 11 22 33 66 77 88
Hope this helps,
Cheers,
Jochen @rapidlasso