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 parsing 2-byte LAS scan angle (fix #58451) #58963

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

dvdkon
Copy link
Contributor

@dvdkon dvdkon commented Oct 3, 2024

Description

Currently in QGIS the ScanAngleRank LAS(/LAZ) field is typed as a short and is read as a single signed byte. The LAS 1.4 specification introduced a new field, ScanAngle, which is logically a two-byte fixed-point number, to replace ScanAngleRank in new formats. Right now QGIS tries to read this field as ScanAngleRank, so the result is an incorrect integer value.

This PR changes the type of ScanAngleRank to float and fixes parsing the new LAS 1.4 formats, unifying ScanAngleRank and ScanAngle into one general property, just as PDAL does.

Will fix #58451.

@github-actions github-actions bot added this to the 3.40.0 milestone Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 9db9aed)

Copy link
Contributor

@uclaros uclaros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
Tests were built with the buggy behavior and will need tweaking

Also, adding fix #58451 to the description text, rather than the title, will link and auto close the issue!

src/core/pointcloud/qgslazdecoder.cpp Outdated Show resolved Hide resolved
src/core/pointcloud/qgslazdecoder.cpp Outdated Show resolved Hide resolved
@uclaros uclaros added Bug Either a bug report, or a bug fix. Let's hope for the latter! Point Clouds labels Oct 4, 2024
@dvdkon
Copy link
Contributor Author

dvdkon commented Oct 6, 2024

Nice! Tests were built with the buggy behavior and will need tweaking

Also, adding fix #58451 to the description text, rather than the title, will link and auto close the issue!

Thanks for the review! I admit I (ab)use GitHub's CI to show me which tests need attention, since I get too many false positives on my machine. They should all be fixed now.

@wonder-sk wonder-sk merged commit 91d5676 into qgis:master Oct 8, 2024
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Point Clouds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with decoding ScanAngleRank in LAZ files
4 participants