The spatial model: one register, more than one drawing of it
What this document is. The argument for why the site map surface is built the way it is, in terms that survive the conversation that produced it. It is not a feature list. The surface is the visible end of a model, and the model is the point.
Status. Written 2026-08-01 by Claude Opus 5 (Claude Code), from a working
session with Pete Jones. It describes code that exists on feat/rn-app-parity
and is NOT deployed — see WORKLIST.md E11.
One register, three drawings of it
*Diagram 18 — diagrams/SDMS/ESG/18_one_register_three_drawings.svg. The whole
argument on one page: the rule, the register, the three views, and why the two
maps cannot drift apart.*
1. The problem this exists to solve
A compliance record has to bind to a place. That much is uncontroversial and every system claims it.
The uncomfortable part is the next sentence: a place has more than one legitimate drawing, and they disagree with each other.
An environmental consultant standing on Queen Street east of Broadview wants the corridor where it really runs, over the real streets, because that is the drawing they can stand in front of and check against the ground. The same corridor, shown to a site meeting, wants the diagram from inside a train car — straight runs, even spacing, every name legible, and nothing pretending to be a survey. The programme manager reconciling a month of tickets wants neither, because the question is not "where" but "what have we got and what state is it in", and a map is the wrong instrument for that.
Three drawings. Three different sets of coordinates. One site.
The failure mode this model exists to prevent is the obvious one: pick a drawing, call it the truth, hang the data off it. Then the second drawing gets hand-authored beside the first, the two drift, and the console holds two different claims about which control area a record is in. On a compliance system that is not a cosmetic bug. It is the system quietly disagreeing with itself about an obligation.
2. The move: identity does not carry geometry
The whole model turns on one decision.
Zone = { id, label, sub, tone, category } ← what a thing IS
ZoneShape = { x, y, w, h, r?, d?, seg?, leader? } ← where it is DRAWN
A zone carries no coordinates. Nor does an asset, nor a record. Coordinates
live in a PlanView, which is one drawing of the plan and holds nothing but
geometry, keyed by the identity it is drawing.
SitePlan
├── zones ── the register: identity only
├── assets ── the register: identity only
├── plotted ── the register: content only
└── views[]
├── Planimetric { zone: {id → shape}, asset: {id → point}, pin: {id → point}, basemap }
├── Schematic { zone: {id → shape}, asset: {id → point}, pin: {id → point} }
└── Tabular { no geometry at all }
The consequence is the point: a zone cannot be in two places, because there is only one of it. A view cannot disagree about what a thing is; it can only disagree about where to put it on paper. Every count, every history, every "what is recorded here" is computed from the register and is therefore identical in all three modes by construction, not by discipline.
This is also the structural bridge to the larger topological model. Identity is the base space. Each view is a section over it. Nothing in the code says those words, and it does not need to — the shape is what matters.
3. The three modes, and the right words for them
The UI says these words, with a plain-English gloss underneath, because the terms are correct and nobody should have to already know them.
| Mode | The proper term | What is true | What is not |
|---|---|---|---|
| Planimetric | georeferenced; true horizontal position, to scale | position, distance, adjacency, what street you are on | it is not a survey and not an alignment sheet |
| Schematic | topological; topologically accurate, geometrically distorted | order, extent, overlap, sequence along the line | position, spacing, direction, distance |
| Tabular | aspatial / attribute view | what exists and what state it is in | nothing spatial is implied, deliberately |
Planimetric is the default and the mode to work in. Schematic is what you show a room. Tabular is what you sort.
Two further terms are worth having, because they are what a corridor actually uses:
- Linear referencing (LRS) — position as a distance along a route rather than as a coordinate pair. "Chainage", "station", "route-and-measure" are the same idea.
- Planimetric vs. schematic is the honest label pair for the two maps. "Geo-accurate / geo-simplified" is fine in conversation; these are the words a rail engineer expects on a drawing sheet.
4. The schematic is DERIVED, never drawn twice
This is the single most important implementation decision in the model, and it follows directly from §1.
Every stop and every control area is reduced to its chainage — how far along the real alignment it lies — and then laid out along a simplified spine at that same fraction. A control area drawn as a circle in the planimetric view becomes a band in the schematic: the circle's centre projects onto the line, and its radius becomes a length of line either side. A zone that is 800 m across covers 800 m of alignment whichever way it is drawn.
real route (lat/lon)
│
├── kmAlong(zone centre) ─────► chainage interval [k₁, k₂]
│ │
│ ▼
└── spine(hand-drawn polyline) ─► position at that same fraction
Therefore order, extent and overlap are true in both views by construction. Not by anyone remembering to update the second drawing. The only hand-authored geometry in a schematic is the spine polyline itself — a few points saying "runs east, turns north-east, then north". Everything else is computed.
What the schematic gives up, it gives up knowingly, and says so on its face. That is the deal every transit diagram strikes; the difference here is that the deal is enforced by the code rather than promised in a caption.
5. Zoom, level of detail, and drill-down are three different moves
Moving around the plan
*Diagram 19 — diagrams/SDMS/ESG/19_modes_levels_and_drilldown.svg. The controls
themselves: which drawing, how close, which layers, and what each level draws
INSTEAD of what it is not drawing.*
They are constantly conflated, and conflating them is why map interfaces end up with a back button that sometimes zooms out and sometimes navigates.
| What changes | What it answers | Needs | |
|---|---|---|---|
| Zoom | scale only | "let me see this bit bigger" | a scale control |
| Level of detail | what is drawn at that scale | "show me what is legible here, and no more" | rules |
| Drill-down | the context you are in | "take me inside this thing" | a hierarchy and a breadcrumb |
Zoom is at named levels, not free. Corridor · District · Street (Site · Wing · Unit indoors). A continuous zoom makes the visibility rules mushy: labels fade in at scales nobody chose, and two people looking at "the same" view see different things. Named steps mean the rules can be stated — which matters when the thing being hidden is a compliance record.
Level of detail aggregates; it does not hide. At Corridor level a control area carries one badge: how many records are in it, coloured by the worst one present. Never the average. A zone with one open NCR and nine passes is not 90% fine, and a green badge over it would be a lie of composition. Coming in one level swaps the badge for the records themselves; coming in again names the assets they are about. Nothing is silently dropped — what is not drawn at a level is summarised at it.
Drill-down is the containment hierarchy, with a breadcrumb, because it is a place you can be inside of rather than a magnification you can see:
Site › Control area › Asset › Record
Level of detail applies to the planimetric view only. A transit diagram that needs zooming has failed at its own job, and hiding its station names until someone zooms would break the one thing it is better at than the real map.
6. Layers are a question about the site, not a styling switch
Every control area on a corridor carries a category — the legend of the environmental layer an inspector actually reasons in:
spill · watercourse — vegetation — erosion · sediment — air · dust —
waste · excess soil — lighting · noise — archaeological —
wells · groundwater
Turning a layer off changes the question the drawing answers. The tabular view honours the same toggles for exactly that reason — the filter is a statement about the site, not about the picture.
Category is deliberately not the same field as the drawing tone. Tone is how a zone is drawn; category is what it means, and a drawing convention should never be doing a domain's job.
Everything is on by default. A compliance surface that opens with things hidden is one where somebody eventually misses a thing that was never on screen.
7. Where this is going: the topological model
The view split above is the first step of a longer architecture, and it was chosen to be that step rather than a UI convenience.
The build order, deliberately practical first:
- Stable entity identifiers — done. Identity is the thing views hang off.
- Chainage intervals — done.
kmAlong/spine; every zone already reduces to an interval along a route. - Per-view geometry tables — done.
PlanView.zone / .asset / .pin. - Containment hierarchy — partly. Site › area › asset › record exists as navigation; it is not yet a first-class relation.
- Adjacency and connectivity edges — not started. Overlap between two control areas is currently derivable from chainage intervals but is not stored as an edge, so nothing can traverse it.
- Versioned relationship history — not started.
- PostGIS for spatial operations; graph/edge tables (or Neo4j) when traversal becomes substantial — not started. Everything today is a static module in the browser.
- Topology changes recorded through the State Ledger — not started.
Why the maths is not decoration
Two ideas describe what is being built, and they answer different questions.
Fiber bundles — what is attached locally. Every zone, asset, interval and time slice has a structured state space sitting over it: condition, risk, obligations, evidence, responsible parties, expected state and deviation from it. An asset is not a point on a map with a label; it is an identity with an attached state space. The base space is the corridor spine, the containment hierarchy, the connectivity graph — and time.
Sheaves — how local truths combine. Local observations (a zone inspection, a permit condition, a contractor update) have to restrict down to smaller contexts and glue up into a corridor-wide claim. Where they cannot glue, that is an obstruction — a contradiction, a gap, a missing report — and detecting it is the valuable part, not an error case.
The multi-view problem in §2 is the smallest instance of this: three representations of one underlying reality, which must stay consistent. If the planimetric view says a zone contains four assets and the tabular projection says five, that is an obstruction, and the architecture should make it impossible rather than merely unlikely. Splitting identity from geometry is what makes it impossible.
The maths guides the architecture; it does not block the implementation. No category theory is being written today. The order is: build the practical structures, then interpret them.
8. What is true today, and what is not
Stated plainly, because a drawing that looks like an alignment sheet will eventually be used as one.
Real:
- The alignments and the basemaps are OpenStreetMap vector data in Web Mercator. The Ontario Line centreline measures 15.81 km against a published 15.6 — the check that matters, because a straight line between the same terminals would also start and end correctly.
- Chainage, and therefore order, extent and overlap in both map views.
- The derivation: counts, statuses and histories are computed from one register.
Approximate, and labelled as such on the drawing:
- Station points are published locations snapped to the line.
- Control areas are indicative circles, read by eye onto the feature each names.
- Everything in the schematic except order and extent.
Not true at all, and not claimed:
- Nothing is persisted. Plotting a record lives in React state. It does not write to a database, reach the field app, or survive a refresh.
- Nothing binds a record to a location or an asset end-to-end. The vocabulary exists on both sides with matching ids; no capture screen offers a picker, no event payload carries an
assetId, and no report prints one. See WORKLIST E8. - "Stages of work" has no data anywhere in this repo. Not the console, not the field app, not the diagrams. It is not offered as a layer.
- "Elevation" exists only as the tunnelled vs. elevated/at-grade spans on Eglinton. There is no vertical profile.
- None of this is deployed.
esg.cogneris.comservesmain. See WORKLIST E11.
9. Why it matters
A register tells you there are four open NCRs. A plan tells you three of them are in the same yard, which is a different conversation with a different person.
On a corridor it goes further, because the obligation is a function of where you are standing. An inspector walking two kilometres passes out of a TRCA-regulated ravine, into a residential noise band, into rail lands under an excess-soil regulation. Drawing the controls where they actually bind shows that. Overlapping controls show where two authorities bind at once. A grid of boxes cannot say either thing, and a single "correct" drawing cannot serve both the engineer checking the ground and the room being briefed.
That is the purpose of the system: not to store coordinates, but to hold one account of a place that stays consistent across every way of looking at it.
Related
- WORKLIST.md — E13 (this work), E8 (the binding gap), E11 (deployment)
app/lib/sitePlans.ts— the register and the viewsapp/lib/corridorGeo.ts— projection, chainage, spine derivationapp/components/planCanvas.tsx— zoom, level of detail, label placementdiagrams/SDMS/ESG/18_one_register_three_drawings.svg— the model, on one pagediagrams/SDMS/ESG/19_modes_levels_and_drilldown.svg— the controls, on one pagediagrams/SDMS/ESG/13_assets_locations_and_the_site_map.svg— what is built and what is notdiagrams/SDMS/ESG/17_ontario_line_osm_overlay.svg— the reference of record for the Ontario Line