Skip to content

Read ASPRS LAS files versions 1.0 to 1.4 - #76

Open
mahach666 wants to merge 2 commits into
feature/issue-24-leica-parallelfrom
feature/issue-25-las-reader
Open

mahach666 wants to merge 2 commits into
feature/issue-24-leica-parallelfrom
feature/issue-25-las-reader

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Closes #25

Based on #75 (the branch feature/issue-24-leica-parallel); merge the earlier pull requests first.

What changed

  • New LAS reader (PclFileKind.Las, LasDocument/LasScan): versions 1.0 to 1.4 with point formats 0 to 10,
    the legacy and the extended 1.4 point counts, scale and offset, and the coordinate system records when present.
    Positions, intensity (0..1), classification and RGB for the colour formats (2, 3, 5, 7, 8, 10) are read; GPS time,
    return numbers, scan angles, point source ids, near infrared and waveform packet descriptors are not interpreted,
    and extra bytes past a format's base size are skipped. Extended VLRs are not read.
  • PclFile.Open and DetectKind handle .las: detection is by the LASF signature with any extension except
    .laz, which shares the signature and stays unknown until the LAZ reader (issue Format: LAZ (*.laz) #26) exists. A .las file with
    the wrong content is unknown, and opening it throws NotSupportedException.
  • Channel availability follows the file: HasColors for the colour formats, HasIntensities always true,
    HasNormals always false. PointCount is the header count (the extended 1.4 count when it states one) and is
    not checked against the point data until the points are read; a truncated read fails then.

Files changed

  • src/PclIO/Formats/Las/LasDocument.cs: new reader (header, bounded VLR walk, GeoTIFF/WKT coordinate system,
    chunked streaming point reads).
  • src/PclIO/PclFileKind.cs, src/PclIO/PclFile.cs, src/PclIO/Internal/KindDetector.cs: the Las kind,
    detection and opening.
  • src/PclIO.Cli/Program.cs: the help text lists LAS as a detected input format.
  • tests/PclIO.Tests/SyntheticFixtures.cs: LasSamplePoint, CreateSyntheticLas (versions, formats 0-10,
    scale/offset, VLRs, extra bytes, count and record-length overrides) and EPSG/WKT VLR helpers.
  • tests/PclIO.Tests/FormatTests.cs: LAS section (open metadata, round trip, 1.4 extended counts/scale/offset/EPSG,
    all formats 0-10, limit/step, Blocks/parallelism ignored, exporter output reads back, WKT/unknown CRS,
    wrong signature, unsupported version/format, truncated points, short record length, oversized/overrunning/too
    many VLRs, skipped extra bytes).
  • tests/PclIO.Tests/KindDetectionTests.cs: signature detection, wrong-content and .laz cases.
  • tests/PclIO.Tests/RealFileTests.cs: skipped-unless-present .las invariant test.
  • README.md, docs/public-api.md, docs/getting-started.md, CHANGELOG.md: the new behaviour and limits.

Tests

  • dotnet build — 0 warnings, 0 errors.
  • dotnet test — 738 passed, 1 failed, 11 skipped (10 private-scan tests + environment-dependent) on .NET 8
    and .NET 10. The single failure is RepositoryHygieneTests.Git_History_Holds_Only_The_Public_Identity_UTC_Dates_And_Clean_Messages,
    which flags commit 0a78bc6 (the already-pushed issue API: Streaming and parallel decoding for very large files #24 commit) for non-UTC author/committer dates. That
    commit is outside this PR; fixing its dates needs a force-push of feature/issue-24-leica-parallel, which I
    did not do without instruction. Every test covering this PR's changes passes.

Limits

  • Versions outside 1.0-1.4, point formats above 10, and formats 6-10 in a file that is not 1.4 are rejected with
    NotSupportedException at open; a LAS file never guesses.
  • At most 4096 VLRs of at most 1 MiB each; point records at most 1 MiB; EVLRs (after the point data) are ignored.
  • Non-finite computed positions are skipped; Blocks/MaxDegreeOfParallelism are ignored (no independent blocks).
  • LAZ (compressed LAS) is detected as unknown; it needs issue Format: LAZ (*.laz) #26.

@mahach666
mahach666 force-pushed the feature/issue-24-leica-parallel branch from 0a78bc6 to 2183329 Compare November 17, 2026 15:02
@mahach666
mahach666 force-pushed the feature/issue-25-las-reader branch from d08536a to 479c49d Compare November 17, 2026 15:02

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