Skip to content

Conversation

@originlake
Copy link
Contributor

@originlake originlake commented Aug 23, 2025

Hi,

When reading and write las/laz, the original scale and offset stored in the input file is lost, and the output will use the default value of them, which results in a loss in precision when the original data's precision is higher than 0.01m. This PR attempts to preserve the original offset/scale in the output las/laz file.

This PR added two extra member variables for the internal point cloud data structure to store scale and offset. If the input is las file, the scale and offset in metadata will be stored. If the output is las file, the scale and offset will be used to in the output las file.

@pierotofy
Copy link
Member

pierotofy commented Aug 23, 2025

Hey thanks for the PR. Can you please make sure:

  • This compiles/runs without PDAL
  • If scales/offsets are not defined, to not override them (currently you're always overriding them to some default value).

2. prevent edge cases when offsets or scales not exist
@originlake
Copy link
Contributor Author

Hi @pierotofy,

I used the same default value being defined in pdal's writer.las so the outcome would be the same. But you are right, better to let pdal decides what the default value it would use.

I updated the PR as requested.

@pierotofy pierotofy merged commit dd6a560 into uav4geo:main Aug 23, 2025
1 check failed
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