[Christian and I exchanged a few emails off-list to answer his
question.]
> At the moment I am toying around with the txt2las converter. I was
> wondering if it is possible to process all txt-files within a single
> directory using only one command line. I noticed that, for instance,
> the las2dem routine does provide an option (-lof) that enables you to
> process all files that are listed in a corresponding txt-file. But
> unfortunately that is not the case for the txt2las converter.
Do you need to convert all ASCII file into a single LAS file? Because
that is what the '-lof' option does. It merges all listed files (be it
LAS or ASCII) into one.
> Do you have any ideas on how I could use txt2las in order to process
> all txts in a certain dir?
There was a previous posts in the mailing list that pointed out that
all LAStools can now read ASCII. hence you can use
las2las -i files_names.txt -lof -iparse xyzta -skip 2 -o output.las
and all text files listed in "files_names.txt" will be merged into one
"output.las" file with the first two lines of each individual ASCII
file being skipped (simply omit '-skip 2' if skipping is not
necessary).
Christian successfully did that. He wrote that he is currently
converting 2802 ASCII files (> 66 GB) with one command line similar to
the above in one "output.laz" file. I am, however, a bit worried about
the result in case those 66 GB of ASCII contain more points than the
4,294,967,295 points LAS currently allows ... |-:
He also wrote that "the examples in the README files were very
helpful".
He asks whether "txt2las" is redundant given that all tools can read
ASCII and given that las2las can do the conversion as well. Almost,
except reading ASCII from a pipe is only possible with txt2las. For
example when you have some (imagined) classification tool called
classify that outputs ASCII then you can use txt2las to directly pipe
it into a LAS file.
classify -i ASCII.xyztirn -otxt | txt2las -itxt -scale_intensity 65535
-parse xyztirn-o lidar.las
Christian also pointed out a small bug: The list of files option '-i
files_names.txt -lof' does not allow for white spaces or tabs at the
end of
each line in 'files_names.txt' because those will be considered as
part of the file name. I will fix that soon.
cheers,
martin @lastools