libLAS
libLAS copied to clipboard
Python: header min and max not updated
I've found an error in the creation of a new point cloud. I've done the following operations:
- Opened a new las through 'w' mode using a new header (header.Header()));
- Added some points through write function;
- closed the file.
At the end, the point cloud have all the points but it hasn't an updated header (min and max are not correct and are both equal to zero). I'm using Python version.
The Python bindings have not been maintained for longer than libLAS itself. I don't use the bindings myself. Unless someone comes up with a test and fix, this issue is stale.
This doesn't appear to be limited to just Python -- I'm in fact struggling with this myself in C++ at this moment.
Upon destruction of the writer, the record points count is updated, but the bounding box is not updated. The laskernal.cpp
code (not exposed to the API but used by the apps) has a RepairHeader
and RewriteHeader
code that re-opens the file to re-write the header with stats, but attempting this technique corrupts the file for me.