Piping lasheight doesn't seem to work

51 views
Skip to first unread message

Wes Toews

unread,
Oct 18, 2017, 8:58:55 PM10/18/17
to last...@googlegroups.com
This doesn't seem to work properly:

%lastools%\lasthin -i *.las -merged -step 0.5 -ignore_class 2 -inside minx miny maxx maxy -odir temp -o thinned.las -pipe_on | ^
%lastools%\lasheight -stdin -merged -replace_z -odir temp -o normalized.las

It fails with 'could not reopen lasreader'. thinned.las is created, and piping after lasheight works (you can continue additional processes after lasheight and get valid output, i.e. lasgrid)

Any ideas? Am I doing something wrong?

Thanks!
Message has been deleted

Martin Isenburg

unread,
Oct 19, 2017, 1:00:04 PM10/19/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

correct. Currently lasheight can only be output piped ('-stdout') but not input piped ('-stdin') as the algorithm reads over the input twice in order to (1st read pass) determine the ground points used for TIN construction and (2nd read pass) read the file again to compute the height of each point above the TIN and output the result. For single pass lasheight runs (i.e. when an external ground or GEOID is provided) it should work. 

In order for the '-stdin' to work I would have to make lasheight "store" the LAS file to a temporary buffer (compressed?) that is being piped in during the first pass and then make it read it from the buffer for the second pass. It's on my TODO list to make '-stdin' work on all two-pass LAStools such as lasground, lasclassify, lasthin, lasduplicate, ... It'll probably be a bit of a memory hog, though, requiring smaller tiles.

Regards,

Martin @rapidlasso

Wes Toews

unread,
Oct 19, 2017, 1:58:56 PM10/19/17
to last...@googlegroups.com
The lasheight documentation should probably be updated to remove -stdin in the list of inputs :-)

Inline images 1

Martin Isenburg

unread,
Oct 19, 2017, 11:15:16 PM10/19/17
to LAStools - efficient command line tools for LIDAR processing
Hello,

I know and this is why. This information is part of the description that you get when you run

lasheight -h

It is generated by the underlying LASlib library that powers LAStools (not by lasheight itself). It's the LASreadOpener


that let's (advanced) users know that in theory it can read LAS and LAZ files from a stdin pipe ... but piping only works in single-pass mode. It would be tricky to suppress this output from the '-help' output from each tool depending on its operation.

Regards,

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