Fix LAS specification violations#366
Merged
JanuszBedkowski merged 9 commits intoMapsHD:mainfrom Feb 19, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix LAS specification violations and reduce memory usage when exporting LAZ files in
core/include/export_laz.h.Fixes #352
Fixes #358
Changes
LAS spec compliance fixes
floatscale factor:constexpr float scale = 0.0001fproduced0.000099999997474in the header due to single-precision limitations. Changed todouble.exportLaz(): Manual min/max computation from raw doubles didn't match quantized coordinates written to the file, causing points to fall outside the header bounding box. Replaced withlaszip_update_inventory().save_processed_pc():adjustHeader()only transformed 2 of 8 AABB corners, producing an incorrect bounding box when the pose contains rotation. RemovedadjustHeader()and replaced withlaszip_update_inventory().return_numberandnumber_of_returnswere 0, which is invalid per LAS 1.2 spec (valid range: 1-5). Set both to 1 (single return).High memory usage fix
LazWriterhelper class: RAII wrapper around the laszip writer lifecycle (open,writePoint,close). Centralizes LAZ writing logic so multiple callers share the same correct implementation.exportLaz()to useLazWriter: Signature unchanged — all 22 callers across 13 files are unaffected.save_all_to_las()to stream viaLazWriter: Previously copied the entire point cloud into three temporary vectors (pointcloud,intensity,timestamps) before writing. For 218M points this duplicated ~7 GB in memory. Now streams points directly to laszip one at a time — only one point in flight instead of all points buffered.lasinfo64 report — before
lasinfo64 report — after
Zero warnings. (GPS timestamp scaling is a known issue tracked separately.)