[Liblas-devel] LAS File Header Editor
Howard Butler
hobu.inc at gmail.com
Thu Aug 14 23:22:47 EDT 2008
On Aug 14, 2008, at 5:36 AM, Mateusz Loskot wrote:
> Folks,
>
> Can we respond with libLAS this [1] kind of requests?
>
> I've thought las2las would be handful, but I can't find it expained in
> the manual
>
> [1] http://lidarbb.cr.usgs.gov/index.php?s=&showtopic=2033&p=2817
> [2] http://liblas.org/browser/trunk/doc/las2las.txt
>
Mateusz,
Our ports of the utilities don't really support in-place (re)writing
of the LASHeader for a number of reasons. The first is the questions
of which header items would require a complete rewrite of the file.
Some, like the changing DataFormatId in the header without rewriting
the points could have a disastrous effect. Rather than try to protect
the user from all of this headache and have to segregate which items
being rewritten would be disastrous, I think it is in our best
interest to have the user rewrite the file. We're already using stl
streams with read/write caching, so this is going to be relatively
fast (not as fast as a simple header overwrite, but not nearly as
dangerous).
The second reason why I think we shouldn't allow in-place header
(re)writing with the utilities is the philosophy that a LAS file may
be one of a number of things in a single processing chain, and the
intermediate steps of that chain need to be stable so one can trace
back through the chain. Whether or not this is a real concern,
however, I don't know.
I would note that there's nothing that would prevent a C/C++/Python
user from attempting their own in-place header rewriting. They just
need to copy the header (open a LAS file with a reader), close the
reader, and then open the file again with a writer and the update
flag. Then they can do as much damage as they wish ;)
Howard
More information about the Liblas-devel
mailing list