Skip to content

Report the incomplete results of a Leica container - #57

Open
mahach666 wants to merge 2 commits into
feature/issue-5-leica-point-countfrom
feature/issue-6-leica-incomplete-data
Open

mahach666 wants to merge 2 commits into
feature/issue-5-leica-point-countfrom
feature/issue-6-leica-incomplete-data

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Closes #6

Based on #56 (the branch feature/issue-5-leica-point-count); merge the earlier pull requests first.

What changed

  • The Leica reader now counts what it cannot use and reports it in PclDocument.Warnings:
    • the points that were dropped because their slot holds no point (padding, or a point at the origin of a block),
    • the compressed streams that were skipped because their declared length is above the accepted size,
    • the point data that ends at a chunk that is not a point block, with the number of blocks that were read.
  • The new PclReadOptions.Strict makes such a read fail with InvalidDataException instead of adding the warning. The option is
    general; a reader that cannot detect incomplete data ignores it.
  • The same warning is added only once, so that reading a scan twice does not repeat it.

Files changed

  • src/PclIO/PclReadOptions.cs: the new Strict option.
  • src/PclIO/Formats/Leica/LgsxDocument.cs: the counters, the report at the end of a read and the warning helper of the document.
  • tests/PclIO.Tests/SyntheticFixtures.cs: the synthetic container can drop points, write an oversized frame and write a block the reader does not know.
  • tests/PclIO.Tests/FormatTests.cs: new tests for the three cases, for the strict mode and for complete data.
  • README.md, docs/public-api.md, CHANGELOG.md: the new behaviour.

Tests

  • dotnet build — 0 warnings, 0 errors.
  • dotnet test — 605 passed, 0 failed, 10 skipped (the tests that need private scan files) on .NET 8 and .NET 10.

Limits

  • The report is made when the whole point data was read. A read that stops at MaxPoints says nothing, because the counts would
    describe only a part of the data.
  • The point data that ends at an unknown chunk is only reported when at least one block could still have been there; data that is
    shorter than a block header is treated as the end of the data.

@mahach666
mahach666 force-pushed the feature/issue-5-leica-point-count branch from 285ad7e to ddb5617 Compare November 17, 2026 15:01
@mahach666
mahach666 force-pushed the feature/issue-6-leica-incomplete-data branch from cf0c5ae to 1fdf732 Compare November 17, 2026 15:01

This branch has not been deployed

No deployments
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.

1 participant