Skip to content

Commit f8297bc

Browse files
authored
Merge pull request #42 from AdaWorldAPI/claude/fix-osm-id-hierarchy-claim
fix(domain-instances): OSM IDs are flat per-type spaces; adapter constructs prefix from coordinates
2 parents 03b2f87 + 5b1fd22 commit f8297bc

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

docs/DOMAIN-INSTANCES.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,35 @@ inner auth AND durable outer audit, and ships exactly that separation.
125125

126126
### 2.6 Geospatial / OSM — geographic calibration
127127

128-
**What OSM proves: geography doesn't break the IR.** OSM IDs are
129-
*already* prefix-structured (`country/region/city/street/house`), so
130-
the adapter is doing identity-*extraction*, not identity-construction
131-
— a much smaller surface than typical. Three OSM Classes (`Node`,
132-
`Way`, `Relation`) lift via the queued `ogar-from-osm-pbf` adapter
133-
(`docs/RDF-OWL-ALIGNMENT.md §10` Phase 2c). Exercises:
128+
**What OSM proves: geography doesn't break the IR.** OSM elements use
129+
**per-element-type flat numeric ID spaces** ([OSM data model][osm-dm]
130+
`Node 100`, `Way 100`, and `Relation 100` are unrelated; IDs are
131+
not hierarchical and carry no spatial information on their own). The
132+
adapter therefore does identity *construction*, not extraction: it
133+
computes the Cesium TMS quadkey from the element's **resolved**
134+
geometry — only `Node`s carry coordinates directly; `Way`s and
135+
`Relation`s reference other elements and must be resolved through
136+
their members first:
137+
138+
- **`Node`** — quadkey from its own `lat`/`lon` (the only element
139+
type that carries coordinates).
140+
- **`Way`** — resolve the ordered `Node`-references first to get the
141+
underlying lat/lon list, then take the centroid (or the smallest
142+
covering tile at the target zoom — whichever fits the consumer's
143+
query pattern).
144+
- **`Relation`** — resolve member references recursively (members
145+
are `Node`/`Way`/`Relation` refs with roles), then centroid /
146+
covering tile, or an `admin_level`-boundary walk when the
147+
Relation IS an administrative polygon.
148+
149+
The resolved quadkey gets prepended to the per-type OSM ID, yielding
150+
the `NiblePath` form `osm/<quadkey>/<type>/<id>`. The quadkey IS the
151+
spatial frame; the per-type ID is the leaf inside it. Three OSM
152+
Classes (`Node`, `Way`, `Relation`) lift via the queued
153+
`ogar-from-osm-pbf` adapter (`docs/RDF-OWL-ALIGNMENT.md §10` Phase
154+
2c). Exercises:
155+
156+
[osm-dm]: https://wiki.openstreetmap.org/wiki/Data_model
134157

135158
- **Spatial prefix-locality** — Cesium TMS quadkey as `NiblePath`
136159
prefix, per Q2 coordination outcome locked in `lance-graph` PR #473

0 commit comments

Comments
 (0)