Skip to content

p7-s3: lidar import (PDAL) #243

Closed

Description

@JArmandoAnaya

Part of the Road to Parity roadmap.

Scope

  • Point-cloud ingestion (PDAL) as visual reference and ground-fitting input.

Acceptance

  • A lidar tile loads, renders decimated, and can seed the heightmap (p5-s4).

Out of scope

Automatic feature extraction from point clouds.

Supersedes

(none)

Activity

  1. added
    pillar:P7
    on Jul 15, 2026
  2. JArmandoAnaya commented on Jul 27, 2026

    @JArmandoAnaya
    ContributorAuthor

    2026-07-27 roadmap review — corrections and cross-references (issue written before recent landings; body stands, read with these):

  3. JArmandoAnaya commented on Jul 29, 2026

    @JArmandoAnaya
    ContributorAuthor

    ADR ruling posted before implementation, so it reads as a decision rather than an omission.

    This issue's title names PDAL. PDAL is not being taken, and ADR-0011 records why.

    PDAL's own build files (read at github.com/PDAL/PDAL, not its README):

    # cmake/proj.cmake     find_package(PROJ 9.0 REQUIRED CONFIG)
    # cmake/gdal.cmake     find_package(GDAL CONFIG REQUIRED)   # FATAL_ERROR below 3.8
    # cmake/geotiff.cmake  find_package(GeoTIFF REQUIRED 1.7.0)

    ADR-0010 ruled one day ago that PROJ and GDAL are not dependencies, and stated that if PROJ ever enters, "the proj.db delivery work is that sprint's scope, not a rider on it". PROJ is not an optional PDAL feature — PDAL delegates all spatial-reference handling to GDAL, which hard-requires it — so adopting PDAL here would take that packaging work as exactly the rider ADR-0010 named as "how it would get done badly".

    What ships instead: ASPRS LAS 1.0–1.4 read in RoadMaker's own code. LAS is a fixed-width binary format (a 227/235/375-byte public header by version, VLRs, point records of a header-stated length in one of eleven documented layouts), and its CRS travels as either GeoTIFF GeoKeys or OGC WKT — both of which #242 already parses. The only new dependency is laz-perf 3.4.0 for the LAZ chunk decoder: Apache-2.0, and its root CMakeLists.txt calls find_package zero times.

    The acceptance is unchanged — a lidar tile loads, renders decimated, and can seed the heightmap — and .laz is included because that is the form real tiles (USGS 3DEP, OpenTopography) actually ship in.

    Scope corrections to this issue, before coding:

    • The scope line's "(PDAL)" is retired by ADR-0011.
    • LAS 1.5 is out of scope and refused by name → p7-f4: LAS 1.5 point-cloud reading #490 (p7-f4).
    • Waveform packet records and EVLRs are skipped and counted in a warning, not parsed.
    • "Automatic feature extraction" stays out of scope as written; the ground fit is a lowest-point/classification bin, not a classifier.

    Landing as three PRs, in the #242 shape: #491 (the decision) → the kernel → the editor.

  4. moved this from Todo to In Progress in RoadMaker Roadmapon Jul 29, 2026
  5. moved this from In Progress to Done in RoadMaker Roadmapon Jul 29, 2026
  6. JArmandoAnaya commented on Jul 29, 2026

    @JArmandoAnaya
    ContributorAuthor

    Closed 2026-07-28 by #493. Three PRs: #491 (the decision), #492 (the kernel), #493 (the editor) — main ddc13ee → 2fda009 → 7d089d3.

    The decision this sprint had to make first

    This issue's own scope line said "Point-cloud ingestion (PDAL)". PDAL's build files find_package PROJ 9.0 REQUIRED, GDAL 3.8 REQUIRED and libgeotiff REQUIRED — so taking it would have re-imported, as a rider on a feature sprint, exactly the dependency ADR-0010 declined two days earlier, and whose packaging cost that ADR explicitly said belongs to its own sprint rather than to a rider on one.

    So ADR-0011: RoadMaker reads ASPRS LAS 1.0–1.4 itself, reusing the roadmaker::gis CRS layer unchanged. laz-perf 3.4.0 (Apache-2.0) is the only new dependency, decoding the LAZ chunk stream and nothing else.

    Acceptance

    A lidar tile loads, renders decimated, and can seed the heightmap (p5-s4).

    All three, plus the refusals:

    • Loads — .las and .laz, LAS 1.0 through 1.4, point record formats 0–10, CRS from a LASF_Projection GeoKey directory (34735) or OGC WKT (2112), reprojected through the same CrsTransform p7-s2: GIS vector/raster import (GDAL/PROJ) #242 built. LAS 1.5+ is refused by name, citing p7-f4: LAS 1.5 point-cloud reading #490.
    • Renders decimated — a third ReferenceLayerKind drawn as a real PrimitiveKind::Points path, coloured by height, with the ratio in its status line. The stride is decided from the header before a point is read (a tile too large to hold is also too large to read and then thin), is deterministic rather than sampled, and is always reported.
    • Seeds the heightmap — Edit ▸ Terrain ▸ Seed from Point Cloud… through the existing edit::set_terrain_field, so it is one undo entry with every p5-s2 invariant inherited.
    • Refuses by name — a CRS outside the bounded family gets gis::crs_transform's own message and its p7-f2: arbitrary-CRS reprojection (the PROJ escape hatch) #485 citation, uncopied, so all three importers say the same thing about the same file.

    Automatic feature extraction stays out of scope, as written.

    Three design points that are load-bearing rather than incidental

    • Coordinates are floats relative to a double origin, and that survives to the GPU — the editor carries PointCloud::origin as an instance matrix rather than baking it into the vertex buffer. At a UTM northing near 5.8 × 10⁶ m a float's quantum is about half a metre, so a cloud held in absolute floats terraces itself into visible steps.
    • A ground fit is a binning fit, not a classifier. It takes the mean of ASPRS class-2 returns and falls back to the lowest return only where the file classified none — the minimum rejects roofs and canopy but pays half a cell of downhill bias on a slope, and where the file has already done that work there is nothing left for it to buy. Which one ran is always named, because they disagree under a bridge.
    • Empty posts are interpolated from their neighbours, never written as zero. Zero is a claim that the ground is at the vertical datum, not a missing value.

    A loose end #242 left, closed here

    Document::refit_reference_layers() shipped dead — defined by #242 and called from nowhere. Reopening a scene re-derived its layers; changing the georeference live left them over the wrong ground. GW-2 step 31's pass criterion already declared that a failing run, so the gap was written down before it was closed. It is now wired into the world-georeference Apply path and pinned by a test.

    Two test-design lessons, from sabotage runs that PASSED

    Worth carrying into #244:

    • A fixture whose values are exactly representable in the type under test proves nothing about that type. Forcing the cloud origin to zero left the entire suite green — not luck but arithmetic: the tile's 5 m lattice survives an absolute float at UTM magnitude, because the quantum there is exactly 0.5 m. A dedicated precision_probe.las carrying centimetre offsets was needed.
    • Loosening a tolerance to accommodate real noise can silently retire the gate that caught the bug. The mean-vs-min estimator was found by a failing test, then un-pinned when its tolerance was widened to cover legitimate binning noise. The replacement gate is exact instead: with a 5 m lattice under 10 m posts every interior post collects the same 2×2 block, so the mean lands 0.175 m below the plane and the minimum 0.350 m below it — two constants, a factor of two apart.

    A third bug was found by running the worked example rather than trusting the tests: laz-perf's writer emits only its own VLRs, so the committed .laz fixture had no coordinate system at all — and the suite passed, because it compared coordinates and classification but not CRS.

    Verification

    ctest 2627/2627 · pytest 381 passed, 1 skipped · ASan + UBSan over core and editor binaries with zero findings · six sabotages per PR, each rebuilt and re-run · #493 was 15/15 on the first push.

    GW-2 gained steps 34–37 and three pass criteria; the hand-run remains outstanding and is epic #256's release-gate item. Follow-up #490 (p7-f4, LAS 1.5) is filed, labelled, milestoned and on the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pillar:P7

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions