Integrating ground and non-ground laz files to single laz

109 views
Skip to first unread message

Max Musterman

unread,
May 24, 2018, 11:22:23 PM5/24/18
to LAStools - efficient tools for LiDAR processing
Hi everyone,

I have two file sets - ground and non-ground of xyz data.
To save storage:
Converted it to laz.
Now, instead of having two laz files for ground and non-ground with same extent -  I'd like to integrate them into a single file .laz

How?
Thanks!!!


Susana Gonzalez

unread,
May 25, 2018, 7:55:26 AM5/25/18
to last...@googlegroups.com

Hi,

You can try this

 

C:\LAStools\bin\lasmerge.exe -i F:\BareEarth\TileName.laz F:\AboveGroundData\TileName.laz -o F:\ClassifiedPoints\TileName.laz -olaz

 

Cheers

Susana

Yogendra Karna

unread,
May 25, 2018, 7:55:36 AM5/25/18
to last...@googlegroups.com
Hi, I have already asked the same question and got a reply so hopefully, this discussion will help you.

Regards,
Yogendra

Yogendra K. Karna
PhD Student
School of Ecosystem and Forest Sciences
The University of Melbourne

Water St., Creswick, VIC 3363, Australia

T: +61 3 5321 4257

M: 0410 207 191

E: yka...@student.unimelb.edu.au


------------------------------------

Under-Secretary (Technical)

Ministry of Forests and Soil Conservation

Government of Nepal



Martin Isenburg

unread,
May 27, 2018, 8:04:15 AM5/27/18
to LAStools - efficient command line tools for LIDAR processing
Hello,


I have two file sets - ground and non-ground of xyz data.
To save storage:
Converted it to laz.
Now, instead of having two laz files for ground and non-ground with same extent -  I'd like to integrate them into a single file .laz

Very laudable ... (-;

So I think Max does not just want to merge the two files but also keep them classified in their respective ground (2) and non-ground (1) classes of the LAS format. So assuming that there are two files 'ground.txt' and 'nonground.txt' where each lines looks like this

Time[s],Easting[m],Northing[m],Elevation[m],Intensity
209362991.062863,257615.7072,469416.7149,40.9921,2732

I would use this set of command lines:

:: convert and set classification to ground (2)
txt2las -i ground.txt ^
           -parse txyzi ^
           -set_classification 2 ^
           -o ground.laz

:: convert and set classification to unclassified (1)
txt2las -i nonground.txt ^
           -parse txyzi ^
           -set_classification 1 ^
           -o nonground.laz

:: merge and add correct projection info
lasmerge -i ground.laz ^
                -i nonground.laz ^
                -wsg84 -utm 32north ^
                -o merged.laz

:: if time stamps are Adjusted Standard GPS time then set the bit
lasinfo -i merged.laz ^
           -set_global_encoding 1

Regards,

Martin @rapidlasso

Max Musterman

unread,
May 27, 2018, 9:05:38 PM5/27/18
to LAStools - efficient tools for LiDAR processing
Hi Everyone!

Thanks so much for your input - it's highly appreciated!!!!

SO I have classified the laz files to 2 and 5, they have the correct projections so all set and ready to go.
I think my problem is automating the whole thing.
I have a list of files called
342-6322_2k_grd.laz  
342-6324_2k_grd.laz
342-6326_2k_grd.laz

And correspondingly
342-6322_2k_veg.laz
342-6324_2k_veg.laz
342-6326_2k_veg.laz

Now i would like to merge just those files so I get something like this:
342-6322_2k.laz
342-6324_2k.laz
342-6326_2k.laz

I have tried the following:
lasmerge    -i %classifiedground%\*.laz ^
                 -i %classifiedVeg%\*.laz ^
                 -olaz -odir %OUTPUTFinalLAZ%

This will produce an error saying no output specified. Usually I can run scripts in this format for many files though. I am assuming that because I have two separate input files i need to start looping and matching the corresponding files? How do I do that in this case with batch? I am only familiar with python and javascript.

Thanks again for helping out!!!!

Martin Isenburg

unread,
Jun 10, 2018, 1:14:15 PM6/10/18
to LAStools - efficient command line tools for LIDAR processing
Hello Max,

I am assuming that because I have two separate input files i need to start looping and matching the corresponding files? How do I do that in this case with batch? I am only familiar with python and javascript.

Correct. You will either need a script of some quick text editor magic to create a loop or a list of commands that pairs up two input into a single output like this:

lasmerge -i 342-6322_2k_grd.laz -i 342-6322_2k_veg.laz -o  342-6322_2k.laz 
lasmerge -i 342-6324_2k_grd.laz -i 342-6324_2k_veg.laz -o  342-6324_2k.laz  
lasmerge -i 342-6326_2k_grd.laz -i 342-6326_2k_veg.laz -o  342-6326_2k.laz  
...
 

Max Musterman

unread,
Jun 12, 2018, 3:48:06 AM6/12/18
to LAStools - efficient tools for LiDAR processing
Thanks Martin!
In case someone else runs into the same issue, I wrote a script in powershell that calls a little las script. That does the job.
SO automate itterating through two separate folders grd and veg and merge corresponding files in temp folder. then rename copy into destination folder and then delete the stuff in temp, do next file.
All u need to do is adjust to the file names, folder names and splits that work for you. files are in.txt so they can besafely shared. Chance the Batch script ending to .bat and the powershell script ending to .ps1
Cheers
MergeGRDVEG_PowerShell.txt
MERGEGRDandVEGBatch.txt
Reply all
Reply to author
Forward
0 new messages