Skip to content
news / clearance-measured-not-tagged · raw .md
Compliance7 min readMapMap engineering
A road drawn in section with a deck spanning above it, the vertical gap between the two bracketed by tolerance ticks, and one stretch of the road left blank where no measurement exists.

Clearance measured from a survey, not read off a tag

POST /v1/clearance/along takes a route shape and a vehicle height and answers whether the vehicle passes under what a survey measured, rather than under what the map records. On one UK OpenStreetMap extract, 18,353 of 8,212,278 highway ways carry a maxheight tag. For every other way there is no recorded height limit for a truck router to enforce, so it returns the road as passable, and that answer is indistinguishable from one where every structure was checked.

Why does a truck router pass under a bridge it has never heard of?

Because a router can only enforce a restriction the map records, and the absence of a tag is not evidence that anybody looked. We measured that on a single uk.osm.pbf extract dated 5 August 2026 and published the counts with their denominators in truck restriction data, measured.

Highway ways in the extract8,212,278
Ways carrying maxheight18,353
Ways carrying maxheight:physical107
Height-tagged ways in one Cumbria sample0 of 893 major bridge ways

Two different things go wrong there. The first is absence: on this data, no recorded height limit is the ordinary case rather than the exception. The second is what a tag means when it is present. maxheight is a posted legal limit and maxheight:physical is a measured physical one, and there are 107 of the latter in the whole extract. Neither describes the branch of a mature street tree hanging over the nearside lane, a temporary gantry, or a service run slung under a deck. Those obstruct a vehicle exactly as concrete does, and nothing posts a limit for them.

We wrote this limit down when dimensional routing shipped. Truck routing with dimensions enforced in costing says an unsurveyed low bridge carrying no maxheight will not block anything, and that this is a data-coverage limit no amount of engine work removes. The clearance endpoint is what that sentence tells you to go and get.

For scale from outside our own data: Network Rail's struck-bridge dataset runs to more than 5,000 structures, and 1,666 strikes were recorded in 2024/25, roughly one every five hours.

What does a measured clearance measure?

The gap between the road surface and the lowest validated surface above it, taken from one dated survey's own point geometry, walked station by station along your corridor. Because both heights come from the same cloud, the same epoch and the same processing, a constant vertical offset cancels exactly in the difference, so the absolute vertical basis never enters the arithmetic. A terrain model contributes nothing at any point, and a survey published as height above a digital elevation model is refused rather than caveated.

Every measurement carries four numbers and none of them is optional.

FieldWhat it is
headroom_mThe lowest validated surface above the corridor, less the road surface under it
sigma_mCombined one-sigma measurement uncertainty, applied at two sigma
sampling_gap_mA one-sided bias bound: the true low point can hang below the lowest sample anybody took
safe_headroom_mheadroom_m less two sigma less the sampling gap, and the figure to plan against

overhead_class labels what was above you as structure, vegetation, wire or unknown. Foliage and wires are labelled rather than dropped, because a branch across a lane is a real obstruction, and because a figure measured off seasonal, compressible foliage is a different kind of figure from one measured off concrete.

What are the four verdicts, and why is one of them a refusal?

verdictWhat it says
passEvery assessed station clears the vehicle by more than the stated bound, over coverage with no gaps
failAt least one station does not clear the vehicle on the measured figure, with the worst point named and every other one listed
indeterminateThe vehicle clears the measurement but not the bound on it, or the deciding surface is foliage on a survey too old to trust
no_verdictCoverage gaps prevented an answer. Not a fail, and emphatically not a pass

A pass over ground nobody surveyed is blocked by the wire format rather than by a rule somebody remembered to apply. coverage is two distinct shapes, the complete one has no field a gap could go in, and the passing verdict admits only that shape, in the Rust and in the TypeScript alike. "We measured no obstruction here" and "we have no data here" are different answers, and the wire format cannot conflate them.

Unsurveyed ground and ground a survey reached but could not decide on arrive separately, as located runs of route, because the two have different remedies: one wants a survey and the other wants a better one. A refusal is also not always thin coverage. The commonest reason a station under a structure has no usable cell is occlusion, which is to say the survey could not see through the thing above you.

What the response refuses to claim

Every report ships a clearance_enforcement block whose route_certified field is false. The field is a type rather than a boolean, so there is no value of it that serialises to true, and the response text is swept in tests for "legal", "compliant" and "permitted", with the enforcement caveat excluded by identity.

A posted height carries a margin somebody chose and it carries legal force. A measurement carries neither. Where a posted height and a measured gap disagree, that is a matter for the road authority that posted the sign, and it is not something a survey settles or this endpoint edits. Your own operating margin is margin_m: it defaults to zero, it is added to the vehicle before the verdict, and it is echoed back.

What it does not do

  • Swept path is out of scope. A route shape is a centreline approximation and lane position is not recoverable from it. The corridor is sampled across the vehicle's width plus a lateral allowance for the registration error between a route shape and the carriageway it stands for. That allowance covers the ordinary bow of the shape between its vertices. It does not cover which lane you are in, and under an arch the outer lane is the direction of danger, because a soffit is lowest at its edges. Lane-resolved geometry is a later phase.
  • There is no headline accuracy figure, on the clearance documentation or here. The bound is computed per measurement from things that genuinely vary between one structure and the next, and a single published figure would be read as a guarantee across surfaces, densities and capture geometries it was never measured on.
  • It answers only where we hold a survey. A deployment holding no clearance data answers 501 to the endpoint, computed across the whole deployment before any caller's visibility is considered, so it can never become an oracle for whether somebody else's data exists. Feature-detect on it.
  • A stale survey cannot pass. An artefact is fresh only when every source it was baked from still matches, and an artefact nobody has checked is treated exactly as one known to lag. Staleness never hides the measurements: the report still carries them, marks the dataset stale and refuses pass.

How do I call it, and what does it cost?

Two calls, because route acquisition and measurement are two different claims with two different failure modes, and folding them together would produce one answer that reads like both.

bash
# 1. A truck route, so the search already avoids what the map records.
curl "$BASE/route/v1/truck/-0.1276,51.5072;-1.8904,52.4862?height=4.2&width=2.55&weight=40&geometries=polyline6" \
  -H "Authorization: Bearer $API_KEY"

# 2. That shape, measured against the survey.
curl -X POST "$BASE/v1/clearance/along" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "geometry_polyline6": "u{~vFvyys@fS]...",
        "vehicle_height_m": 4.2,
        "vehicle_width_m": 2.55,
        "margin_m": 0.0
      }'

Agents get the composition packaged as the check_clearance_on_route tool on the MCP server, which makes the same two calls and returns the measured answer with its bound.

A clearance query is priced in the standard class rather than the truck one, because putting a premium on a safety answer is the wrong incentive. It draws five calls from your allowance, which is more than an ordinary call because it reads baked survey geometry along a whole corridor rather than answering from an index. Measuring a corridor or a network is scoped and bought separately, at fixed prices on the pricing page.

Try it

Read the clearance documentation for the request fields, the full report shape and the list of things the endpoint refuses to answer, each of which is attempted by a test that asserts the refusal. Then tell us which corridor or network you want measured, because a clearance field is baked per dataset from the survey's own point data and it is separate work from a payload bake.

Routing and the tag counts above derive from OpenStreetMap. Credit "© OpenStreetMap contributors" when you render or republish it.