Page 1 of 1
Shift folder of LAZ files vertically
Posted: Thu Jul 29, 2021 12:56 am
by teknick
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!
Re: Shift folder of LAZ files vertically
Posted: Thu Jul 29, 2021 1:26 pm
by daniel
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.
Re: Shift folder of LAZ files vertically
Posted: Sat Jul 31, 2021 11:34 am
by teknick
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?
Re: Shift folder of LAZ files vertically
Posted: Sun Aug 01, 2021 4:53 pm
by daniel
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
Re: Shift folder of LAZ files vertically
Posted: Tue Aug 03, 2021 12:13 am
by teknick
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
Posted: Wed Aug 04, 2021 4:13 pm
by daniel
Well, you can if you write the script that does that (going over each file, and calling this command line each time).
Re: Shift folder of LAZ files vertically
Posted: Thu Aug 05, 2021 10:40 am
by teknick
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
Posted: Thu Aug 05, 2021 8:57 pm
by daniel
Nope, this kind of behavior is generally easier to manage with (system dependent) scripts than within a tool such as CloudCompare ;)