Repository navigation
docs(decisions): OSM ingest reads .osm XML in-house, and .pbf turns on zlib (p7-s4) (#244) - #499
Merged
Merged
Conversation
…n zlib ADR-0012 records p7-s4's format scope. The refusal of .osm.pbf is not the one it looks like: the Protocol Buffers half is a few hundred lines of varint decoding, of exactly the character ADR-0011 chose to write for LAS. It fails on zlib, which every real .osm.pbf uses for its blobs and which this project deliberately does not depend on (deps.cmake sets zlib OFF for libtiff, which is why Deflate sits in ADR-0010's refused column). zlib's arrival is already scoped as #484, and taking it as a rider on a feature sprint is what ADR-0010 said not to do. Reading .osm XML costs nothing: pugixml is already linked, and OSM's only coordinate system is EPSG:4326 — the hub of the bounded family ADR-0010 computes in closed form. So cmake/deps.cmake does not change at all, for the first time in the three import sprints. Adds docs/domain/osm_mapping.md as a governing spec doc: the highway=* and tag tables it carries are mirrored by a code table and held to it by a CI divergence test, the realism_defaults.md mechanism. It states the contract both ways — nothing is dropped silently, AND a way imported without compromise produces no diagnostic at all, because warning about everything is indistinguishable from warning about nothing. Follow-ups filed and cited by the refusal diagnostics: #494 (.pbf, blocked on #484), #495 (roundabouts as one junction), #496 (vertical separation for bridge/tunnel/layer), #497 (persisted ODbL attribution), #498 (unify decimate_ring onto the new public simplifier — held out because it moves geometry in every surface fill, the #442 hazard). Refs #244
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of six PRs for #244 (
p7-s4, OSM road-network extraction + scale targets), the last sprint of pillar P7. Docs only — no code changes, andcmake/deps.cmakedoes not change at all, which is the point.The decision, and why it is not the one it looks like
p7-s4is the third import sprint in a row to open by asking what it is allowed to depend on. It inherits ADR-0010 (no GDAL/PROJ) and ADR-0011 (no PDAL) intact and needs nothing from either: OSM data is WGS 84 lon/lat —EPSG:4326, the hub of the bounded CRS family ADR-0010 already computes in closed form. There is no new coordinate question here. The only open question was the container..osmis XML, and pugixml is already linked (core/src/xodr/reader.cpp), so reading it costs zero new dependencies and zero build time..osm.pbfis refused — on zlib, not on Protocol Buffers. The obvious argument (protobuf is heavyweight) is true of the library and irrelevant, because we would not take the library: the OSM PBF schema uses a handful of field types and a decoder is varints and length-delimited fields, a few hundred lines of exactly the character ADR-0011 chose to write for ASPRS LAS. On that axis.pbfpasses ADR-0011's test.It fails because every
.osm.pbfin circulation stores its blobs aszlib_data, and zlib is deliberately not a dependency —cmake/deps.cmake:195setszlib OFFfor libtiff, which is precisely why Deflate and JPEG-in-TIFF sit in ADR-0010's refused column rather than failing silently. Adding zlib is already scoped work: #484 owns the pinned tag, theURL_HASH, the licences row and the build-cost measurement.So this is the same ruling a third time: the part we actually want drags in work that belongs to another sprint, and taking it here would be taking it badly. ADR-0010's sentence — "the
proj.dbdelivery work is that sprint's scope, not a rider on it" — applies to zlib and #484 without modification.The practical cost is smaller than the 10× file-size difference suggests: the Overpass API returns
.osmXML directly, andosmium cat -o district.osmconverts a Geofabrik extract in one command. The refusal diagnostic says both, names zlib, and cites #494.docs/domain/osm_mapping.md— a governing spec docThe
highway=*and tag tables are markedrm-osmand will be mirrored by a code table incore/include/roadmaker/osm/tags.hpp, withtest_osm_mapping.cppfailing CI on divergence — therealism_defaults.mdmechanism. Landing the doc first means the mapping is reviewable as a policy before any code implements it.Two things in it are worth reading rather than skimming:
roadmaker::defaults. A width literal in the OSM importer would failtest_defaults_registry.cpp's no-private-width-table gate, and correctly so.It also records the reasoning for the judgement calls rather than leaving them to be re-litigated: why
highway=roadbecomes a collector and says so, whyserviceis off by default, whyoneway=-1reverses the polyline instead of the lane direction (@swould otherwise increase against travel and every station-anchored stop line, signal and bridge span would read backwards), why the simplify tolerance is 0.5 m (below OSM's own 1–3 m tracing noise floor, and under one lane width), and whylayerpartitions the topology graph before degree is counted — without that rule the import silently welds an overpass to the road beneath it, which is invisible in plan view and wrong in every 3D consumer.Follow-ups filed
Each is cited by the refusal or compromise diagnostic that would otherwise be a dead end:
.osm.pbf(blocked on #484's zlib) #494 — read.osm.pbf. Blocked on p7-f1: GeoTIFF Deflate and JPEG-in-TIFF decoding #484's zlib; slots in at phase 1 of the importer only.bridge/tunnel/layer. The correctness half (refusing to weld across a layer discontinuity) lands in this sprint; this is the feature half.decimate_ringonto the public simplifier this sprint adds. Deliberately held out: changing which vertices it keeps moves geometry in every surface fill, the byte-identity hazard mesh: fill_backend::inside_region uses Clipper2 PointInPolygon on double paths, which is unsound below 1 m #442 documented.Verification
Every relative link in the four touched files resolves (checked against
--include-fragments, which thedocsjob uses). No source files touched, so the change-detection path filter correctly skips the build matrix.