Hi,
I have a folder of LAZ files and I need to push all of these up vertically by 12cm. Loading them all manually will take at least a week, so I am wondering if there is a way to use the command line to:
Open each LAZ file on after another
move up by 12cm
save as <filename>_shifted.LAZ
I am guessing I can use -APPLY_TRANS {filename}, but coming from a simple 3d background I do not understand how to apply 4x4 translations - in my world we just add 12cm to the z axis on an object!
Any help would be much appreciated!
Shift folder of LAZ files vertically
Re: Shift folder of LAZ files vertically
Yes, the APPLY_TRANS is the way to go, and here is the transformation you need:
1 0 0 0
0 1 0 0
0 1 1 120
0 0 0 1
(mind that '12' should actually be expressed in the right units, here I assumed mm, but it may be meters instead? i.e. 0.12?)
And mind also that you should still apply the default Global Shift when loading files with the command line (-GLOBAL_SHIFT AUTO). It won't impact this 12 cm shift thing, and it's safer.
1 0 0 0
0 1 0 0
0 1 1 120
0 0 0 1
(mind that '12' should actually be expressed in the right units, here I assumed mm, but it may be meters instead? i.e. 0.12?)
And mind also that you should still apply the default Global Shift when loading files with the command line (-GLOBAL_SHIFT AUTO). It won't impact this 12 cm shift thing, and it's safer.
Daniel, CloudCompare admin
Re: Shift folder of LAZ files vertically
Thank you so much Daniel,
For clarity, would you be so kind ask to post the full command that you suggest here? I think I need to save that translation in a text file and then point to it - is that right?
For clarity, would you be so kind ask to post the full command that you suggest here? I think I need to save that translation in a text file and then point to it - is that right?
Re: Shift folder of LAZ files vertically
Yes, save the above transformation matrix in a text file (e.g. transformation.txt).
Then use something like that:
CloudCompare -C_EXPORT_FMT LAS -O -GLOBAL_SHIFT AUTO your_file.las -APPLY_TRANS transformation.txt
And if you want to control the output file name:
CloudCompare -AUTO_SAVE OFF -C_EXPORT_FMT LAS -O -GLOBAL_SHIFT AUTO your_file.las -APPLY_TRANS transformation.txt -SAVE_CLOUDS FILE your_file_transformed.las
Then use something like that:
CloudCompare -C_EXPORT_FMT LAS -O -GLOBAL_SHIFT AUTO your_file.las -APPLY_TRANS transformation.txt
And if you want to control the output file name:
CloudCompare -AUTO_SAVE OFF -C_EXPORT_FMT LAS -O -GLOBAL_SHIFT AUTO your_file.las -APPLY_TRANS transformation.txt -SAVE_CLOUDS FILE your_file_transformed.las
Daniel, CloudCompare admin
Re: Shift folder of LAZ files vertically
That is great - and is it possible to do on a whole folder of files and just leave them chewing through overnight?
Re: Shift folder of LAZ files vertically
Well, you can if you write the script that does that (going over each file, and calling this command line each time).
Daniel, CloudCompare admin
Re: Shift folder of LAZ files vertically
ah - so it is not like I can point at a folder instead of a file and ask it to process all the files inside and then save with a name append?
Re: Shift folder of LAZ files vertically
Nope, this kind of behavior is generally easier to manage with (system dependent) scripts than within a tool such as CloudCompare ;)
Daniel, CloudCompare admin