libLAS icon indicating copy to clipboard operation
libLAS copied to clipboard

Python: header min and max not updated

Open frar opened this issue 7 years ago • 2 comments

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.

frar avatar Oct 27 '17 10:10 frar

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.

mloskot avatar May 06 '20 22:05 mloskot

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.

seanfdnn avatar May 07 '20 18:05 seanfdnn