Batch processing in lastool.exe

1,727 views
Skip to first unread message

Jarlath

unread,
Sep 23, 2011, 2:27:13 PM9/23/11
to LAStools - efficient tools for LIDAR processing
I really like lastool.exe as it provides a more user friendly way to
get students started with LAS tools. Is there a way to batch process
using lastool.exe, I wasn't having any luck?

Thanks,
Jarlath

chuck

unread,
Sep 25, 2011, 12:02:57 PM9/25/11
to LAStools - efficient tools for LIDAR processing
Hi Jarlath,

This is pretty straightforward. Just make sure that the location where
you have LAStools extracted (more specifically the bin folder) is in
the path for your system environment variables. Now you may use some
simple Windows shell scripting (like a FOR loop) such as the following
example which runs lasgrid on a directory of input data to create
output DSM files on the highest of first returns for the specified
cell size:

FOR /f %a IN ('dir /b E:\LAS_TEST\LAS_FILES\*.las’) DO lasgrid –v –i
E:\LAS_TEST\LAS_FILES\%~na.las –o E:\LAS_TEST\DSM_FILES\%~na.tif -step
5 -first_only -highest

The /b for the directory listing returns a bare format and the %~na
returns the 'base name' only without the extension. Thus, you can make
a file with the same base name and a different extension for your
output.I have found it handy to keep base name consistency and use
folders to manage O/P types. This is true n particular if I have a
large tile index (with LAS basename files as an attribute) and I want
to use that same index for managing output rasters or other file
types.

I have tested this for processing thousands of input LAS inputs for
boundary generation, compression, intensity images, DEMs, etc. This
works as a command line input, however to run as full batch you must
change the syntax slightly in the FOR looping. There are lots of
places to get full details about how this is best done.

B/T/W -- I'd be happy to work with you on series of LAB exercises for
using LAStools to process data and perform meaningful processing. I
think it would make a nice workshop or short course.

Good luck!

Regards - Chuck O'Hara

Jarlath

unread,
Sep 25, 2011, 12:43:33 PM9/25/11
to LAStools - efficient tools for LIDAR processing
Thanks Chuck! I have done this using the command line. What I am
looking to do is batch process multiple LAS files using the
lastools.exe. The GUI is nice, particularly for students, but it
seems to only work on single files.

Regards,
Jarlath

Martin Isenburg

unread,
Sep 25, 2011, 1:01:06 PM9/25/11
to LAStools - efficient tools for LIDAR processing
Hi,

the easiest way to batch process large amounts of LAS/LAZ files with
the GUI lastool.exe is by starting with

lastool.exe -i c:\data\mt_somewhere\*.laz

then you instantly have all the files in the GUI to play with. The
other way of adding many LAS/LAZ files is by browsing to the directory
on question and then using the wild card and by pressing <ENTER> in
the wild card text entry field. That should add all files that match
the wild card from the directory you browsed to. To change drives (or
directories) you can also press return in the obvious other text entry
field.

Then ... to process all files instead of only the selected one ... use
the radio button in the top right corner. If you then press run all
files that are processed will be listed in a file called
"file_list.txt" and the <RUN> window will have a roll-out menu that
lists the contents of the "file_list.txt" file.

The GUI is really an easy way to familiarize your students with how to
formulate a command line since it will always show the command line
before executing it (and also print it in the console log).

Cheers,

Martin

PS: Jarlath, what was the version number of Merrick MARS that crashes
when opening LAS 1.4 files that are based on the official spec?
Reply all
Reply to author
Forward
0 new messages