Skip to content

Zero out header point counts when crafting a zero-point file - #348

Merged
connormanning merged 2 commits into
masterfrom
zero-point-files
Oct 14, 2025
Merged

Zero out header point counts when crafting a zero-point file#348
connormanning merged 2 commits into
masterfrom
zero-point-files

Conversation

@connormanning

Copy link
Copy Markdown
Owner

To do a shallow info, we manually grab the header/VLRs/EVLRs for remote LAS/LAZ files and smash them together, without the point data, to frankenstein a file so that we can use PDAL to extract its metadata. We did this without modifying the point count fields in the header so that this field would be extracted as well.

However for uncompressed LAS files, PDAL has a check which compares the point data size with the expected size from the header's point count, so we would run into the error:

readers.las: Invalid point count: 1234. Number of points too large for file size.

For LAZ, this check doesn't happen since the expected file size cannot be determined.

To fix this, this PR does the following:

  • When building the zero-point version of the file, extract the header point count value
  • Then, zero out the modified header point count value
  • Ferry along this explicitly extracted point count so we can use it for our info result

Closes #328 and #332.

@connormanning
connormanning merged commit 200270f into master Oct 14, 2025
15 checks passed
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.

Entwine build fails for LAS file from cloud storage

1 participant