Skip to content

docs(decisions): lidar ingest reads LAS itself, because PDAL requires PROJ (p7-s3) (#243) - #491

Merged
JArmandoAnaya merged 1 commit into
mainfrom
docs/243-adr-lidar-ingest
Jul 29, 2026
Merged

JArmandoAnaya merged 1 commit into
mainfrom
docs/243-adr-lidar-ingest

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

First of three PRs for #243 (p7-s3, lidar import). Docs only — the decision, before any code.

Why this is a PR of its own

#243 is titled "lidar import (PDAL)". ADR-0010, accepted the day before this sprint starts, ruled that PROJ and GDAL are not dependencies — and said explicitly that if PROJ ever does enter, "the proj.db delivery work is that sprint's scope, not a rider on it".

PDAL's own build files settle whether that applies here. Read at github.com/PDAL/PDAL, not from its README:

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

PROJ is not an optional PDAL feature that could be switched off the way libtiff's zlib codec was — PDAL delegates all spatial-reference handling to GDAL, which hard-requires it. So ADR-0010's eighth evaluation criterion fires exactly as written: whether the part you actually want drags the rejected dependency back in.

What ADR-0011 decides

Lidar ingest reads ASPRS LAS 1.0–1.4 in RoadMaker's own code, reusing the roadmaker::gis CRS layer unchanged. The only new dependency is laz-perf, as the LAZ chunk decompressor.

LAS is a fixed-width binary format — a 227/235/375-byte public header by version, VLRs, and point records of a header-stated length in one of eleven documented layouts. Its CRS travels as either GeoTIFF GeoKeys (34735/34736/34737) or OGC WKT (record 2112), both of which p7-s2 already parses. Reading it here is not just cheaper; it keeps one refusal vocabulary across all three P7 importers, because they all refuse through the same gis::crs_transform call.

laz-perf 3.4.0 is the libtiff-shaped half of the decision: Apache-2.0 (literally on the allow-list, so unlike libtiff no per-case approval and no active attribution obligation), and its root CMakeLists.txt calls find_package zero times — no external dependencies at all. Two upstream defaults are recorded here because PR-B must force them:

  • BUILD_SHARED_LIBS defaults TRUE
  • WITH_TESTS defaults TRUE, and its ON path runs file(DOWNLOAD ...) of a sample tile at configure time — a network fetch in a build that must be reproducible offline

Amendment sweep

Everything that named the other route, in the shape ADR-0010 established:

  • docs/roadmap/README.md — the P7 pillar row's "lidar (PDAL)"
  • The P7 milestone description (updated via the API in this pass)
  • docs/roadmap/updates/2026-07-realignment.md — p7-s5's out-of-scope line, whose "datum transformations beyond what PROJ provides out of the box" survived ADR-0010 and was doubly wrong
  • docs/decisions/0006-terrain-scope.md — the remaining third of its "GDAL/PDAL/PROJ import stack" premise. Terrain is unaffected: a point cloud reaches the height field through edit::set_terrain_field, the same door a .asc DEM and an elevation GeoTIFF already use

Deliberately not amended: p7_discovery.md's "no GDAL/PROJ/PDAL in cmake/deps.cmake". It is a dated snapshot, and it stays true after this sprint — which is the point.

Repaired in passing

docs/architecture/kernel.md's module map was stale since p7-s2: it had no gis/ row at all, and still described USD as "planned … currently a stub" long after export_usda and the export previews shipped. The lidar/ row lands with the code in PR-B, not here — a map should not describe a module that does not exist on main.

Follow-up filed

#490 (p7-f4) — LAS 1.5, which is WKT-only (its spec drops GeoTIFF CRS keys) and grows the header to 393 bytes. Refused by name until then, citing that issue.

Next

  • PR-B — roadmaker::lidar, laz-perf, fixtures, tests, Python bindings
  • PR-C — the point-cloud reference layer, the points render path, the menus, GW-2 steps

Refs #243

… PROJ

ADR-0011. #243's title names PDAL; ADR-0010, accepted the day before, ruled
that PROJ and GDAL are not dependencies. PDAL's own cmake settles it:
find_package(PROJ 9.0 REQUIRED CONFIG), find_package(GDAL CONFIG REQUIRED)
with a FATAL_ERROR below 3.8, find_package(GeoTIFF REQUIRED 1.7.0). PROJ is
not an optional PDAL feature to switch off the way libtiff's zlib codec was —
PDAL delegates all spatial-reference handling to GDAL, which hard-requires it.
So taking PDAL would take the ~9 MB proj.db delivery problem as a rider on a
feature sprint, which is the one thing ADR-0010 said not to do.

ASPRS LAS is a fixed-width binary format — a 227/235/375-byte public header by
version, VLRs, and point records of a stated length in one of eleven documented
layouts — and its CRS travels as either GeoTIFF GeoKeys or an OGC WKT string,
both of which roadmaker::gis already parses for p7-s2. Reading it here is not
merely cheaper, it keeps one refusal vocabulary across all three P7 importers.

The one part not reasonably written here is LAZ's arithmetic coder, so laz-perf
3.4.0 enters as the chunk decompressor only: Apache-2.0, literally on the
allow-list, and its root CMakeLists calls find_package zero times. Two upstream
defaults are recorded at the pin because they must be forced — BUILD_SHARED_LIBS
defaults TRUE, and WITH_TESTS defaults TRUE with a file(DOWNLOAD) at CONFIGURE
time, a network fetch in a build that must work offline.

Amends what named the other route: the roadmap P7 row, the P7 milestone
description, the realignment's PROJ-shaped out-of-scope line, and ADR-0006's
remaining "GDAL/PDAL/PROJ import stack" premise. p7_discovery's "no
GDAL/PROJ/PDAL in cmake/deps.cmake" is left alone — it stays true, which is the
point. LAS 1.5 is refused by name and tracked at #490.

Also repairs kernel.md's module map, stale since p7-s2 shipped: it carried no
gis/ row at all, and still described USD as a planned stub two commits after
export_usda and the export previews landed.

Refs #243
@JArmandoAnaya
JArmandoAnaya merged commit ddc13ee into main Jul 29, 2026
12 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the docs/243-adr-lidar-ingest branch July 29, 2026 01:56
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