piping lasheight to lasgrid

47 views
Skip to first unread message

Wes Toews

unread,
Oct 17, 2017, 6:06:44 PM10/17/17
to last...@googlegroups.com
Hi, I'm trying to pipe the output of lasheight into lasgrid via stdout

%lastools%\lasheight -i *.las -cores 8 -replace_z -stdout | %lastools%\lasgrid -stdin -highest -step 1 -otif

However, I don't get any output from lasgrid, and lasheight actually outputs files even though -stdout is invoked. Adding -pipe_on doesn't help either.

The ideal output would be no las files created by lasheight, and a normalized CHM output as a tif for each file in the directory.

Wes

Martin Isenburg

unread,
Oct 17, 2017, 6:36:09 PM10/17/17
to LAStools - efficient command line tools for LIDAR processing
Hello Wes,

Sorry, but command line piping and the multi-core operation that is built into LAStools is not compatible the way you are trying to do this here. I should report an error for this constellation.

For each command line call there is one stdin and one stdout to connect the two processes via the command line pipe "|". In your case the master lasheight call will be the one that gets connected but neither of the cores-many subprocesses that it starts. Also the output file name needs to be set explicitely as there is no file name "coming through" the pipe.

Currently the only way to get this to work is with one call per file:

%lastools%\lasheight -i file1.las -replace_z -stdout | %lastools%\lasgrid -stdin -highest -step 1 -o file1.tif

%lastools%\lasheight -i file2.las -replace_z -stdout | %lastools%\lasgrid -stdin -highest -step 1 -o file2.tif

%lastools%\lasheight -i file3.las -replace_z -stdout | %lastools%\lasgrid -stdin -highest -step 1 -o file3.tif

...

Regards,

Martin

Wes Toews

unread,
Oct 17, 2017, 7:44:16 PM10/17/17
to last...@googlegroups.com
Yeah...so that's too bad!

So we need to make a choice if our tool is IO bound (then use pipes) or CPU bound (then use cores)...do you have any plans to make these two methods compatible? 

Wes


Martin Isenburg

unread,
Oct 17, 2017, 8:24:20 PM10/17/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

the "piping" mode in LAStools (for those tools that support it) is mimicking the UNIX style command line piping based on attaching the stdout of one process to the stdin of the other process. What we could do is create a new tool altogether that really just controls processes. Maybe a new "lasmaster" tool that can start can start multiple processes or pipes in parallel and giving each one a different input and output name.

Let me think about that for a while ... (-:

Martin @rapidlasso
Reply all
Reply to author
Forward
0 new messages