Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: as_las_string_lossy should ignore anything after the first null character #100

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

tobias93
Copy link
Contributor

I just came across a las file with the following Extra-Attributes VLR:

Vlr {
    user_id: "LASF_Spec\0\0\0\0\0\u{18}\0",
    record_id: 4,
    ...
}

The user_id is not properly filled with null characters (see the \u{18} hidden in there...). In this case, as_las_string_lossy currently returns the full string including all null characters. This results in the extra-bytes VLR not being detected correctly in my own code. Most other tools like LasTools or CloudCompare seem to have no problem with this and just ignore anything after the first null character. I changed as_las_string_lossy to work this way, too. Now as_las_string_lossy correctly parses above user id as "LASF_Spec".

@gadomski gadomski self-requested a review December 17, 2024 23:17
@gadomski gadomski merged commit 3871af9 into gadomski:main Dec 17, 2024
12 checks passed
@gadomski
Copy link
Owner

Thanks so much for the fix!! Really appreciate it. https://github.com/gadomski/las-rs/releases/tag/v0.9.3

@tobias93
Copy link
Contributor Author

Hey, thanks for replying (and merging) so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants