Skip to content
news / what-an-adr-result-does-not-prove · raw .md
ComplianceUpdated 8 min readMapMap engineering
A cutaway tunnel section repeated twice: the left bore is ringed by a marked category boundary, the right bore is identical but unmarked, with wide empty space between them.

An ADR route is not a clearance, and the response says so

Every MapMap route carrying a dangerous-goods declaration now returns a tunnel_enforcement block: how the declared ADR tunnel code reached the routing engine, a route_certified flag that is permanently false, and one sentence stating what an unchanged route does and does not prove. We shipped it because the response used to hand back a list of forbidden tunnel categories next to a 200 and leave you to infer a guarantee we do not make. The homepage lost a word the same day. In dangerous-goods routing the gap between "the engine applied your tunnel category" and "this route is legal" is the entire liability, and a vendor who blurs it is selling you a risk you cannot see.

What did the old response imply that we could not back?

That the returned geometry had been checked. The MCP route tool answered a truck request with applied_adr.forbidden_tunnel_categories: ["D","E"] alongside the polyline. That list describes the load: it is ADR 8.6.4 applied to the code you declared. Nothing in the body described the roads that came back. A reader holding a route, a 200 and a list of forbidden categories will join the three up, and we let them.

The marketing said it in fewer words. Our homepage film band read "Truck routing with ADR dangerous-goods compliance, enforced in the costing, not post-filtered". It now reads "restrictions" where it said "compliance", because restrictions are what the costing applies. A front page asserting what the response body disclaims is exactly the drift that gets noticed.

What is in the enforcement block?

Three fields, emitted on every ADR route so the categories can never ship without the boundary that qualifies them. On the MCP route tool it is applied_adr.tunnel_enforcement; on the gateway, a top-level adr_tunnel_enforcement object beside the adr echo.

bash
curl -X POST "https://api.mapmap.ai/route" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "locations": [{ "lat": 51.44, "lon": 0.255 }, { "lat": 51.49, "lon": 0.265 }],
    "costing": "truck",
    "adr": {
      "dimensions": { "height_m": 4.0, "width_m": 2.55, "length_m": 16.5,
                      "gross_weight_t": 40.0, "axle_load_t": null, "axle_count": null },
      "tunnel_code": "C",
      "hazmat": true
    }
  }'

The response is the Valhalla trip verbatim, the adr profile echoed, and:

json
{
  "adr_tunnel_enforcement": {
    "basis": "graph_adr_tunnel_category",
    "route_certified": false,
    "caveat": "forbidden_tunnel_categories describes the load, not this route. Roads are excluded only where the routing graph records an ADR tunnel category (derived from OSM hazmat tagging). An unchanged route therefore means no road on it carried a forbidden recorded category. It does not mean the corridor was surveyed and cleared. Independently verify the tunnels on a planned route before dispatching a dangerous-goods load."
  }
}

basis names the path the code took: merged into costing_options.truck.adr_tunnel_code and matched, during the search, against each road's category as recorded in the routing graph. route_certified is a field rather than only prose so a caller can branch on it, and so it has somewhere to become true if we ship route certification. The caveat wording lives once in the sn-adr crate, so the API, the tools and the docs cannot state the boundary differently.

What does an unchanged route actually prove?

It proves that no road on it carried a forbidden ADR tunnel category that the routing graph had recorded. Categories are derived from OpenStreetMap hazmat:* tagging, so a real ADR-categorised tunnel that nobody has tagged is traversed like any other road, and that response is byte-identical to one where the corridor was checked and avoided. An unchanged route is not a clearance. It is the absence of a recorded reason to detour.

Where did this correction come from?

From a filming session, where someone tried the feature on camera and reported that the ADR tunnel restriction code did not affect routing. Half of that was wrong and half was the whole point.

The wrong half: measured against the live API on 29 July 2026, the code does move the route, at the correct ADR 8.6.4 category boundary. Northbound across the Dartford crossing, a hazmat truck declaring code C was routed 46,057 m and the same truck declaring code D was routed 8,281 m. Through the Beneluxtunnel, codes B and C gave 25,960 m and codes D and E gave 12,033 m. Both boundaries sit at category C, which is what OSM records for those corridors. Re-run on 25 November 2026 with the request above, the Dartford pair still splits at the same boundary: 59,167 m declaring code C and 8,292 m declaring code D. The code C detour is longer than in July, and the boundary has not moved. The original measurement was taken at the Blackwall Tunnel, whose ways carry a plain hazmat=no, where the code correctly cannot matter.

The right half: nothing in the response distinguished "routed around a recorded restriction" from "nothing here was tagged". Two benchmark fixtures now pin the difference instead of leaving it to inference. uk_dartford_tunnel asserts a real detour. uk_blackwall_blanket runs under a code_independent mode asserting both profiles route identically, and records the tagging that makes that correct.

One inconsistency turned up on the way and is fixed. A bad adr_tunnel_code in the adr extension was already a 400, but the same typo in raw costing_options was read conservatively as code B, quietly detouring the load, which at Dartford was 46 km against 8 km when we found it. Both entry points now 400.

Why did the tunnel category move off the edge and onto an access restriction?

Because the previous storage was fragile, and upstream was right about it. We offered the ADR costing to Valhalla, and the review objected to how the category was carried: in three of the four spare bits left in DirectedEdge. The tile format is frozen by written policy, users run pre-built tilesets they cannot rebuild, and one vendor's feature had taken three quarters of the remaining budget. That is a standing conflict with the next upstream change that needs a bit.

Patch 0008 moves the category onto an AccessRestriction record under a new AccessType::kAdrTunnelCategory, category in the restriction value, modes = kTruckAccess. That is the mechanism the engine already uses for maxheight, maxweight and axle load, it needs no new storage, and it leaves DirectedEdge byte-identical to upstream with the three bits handed back. Behaviour is unchanged by construction, and the gurka suite proves it: those tests tag OSM ways and assert routes rather than the edge attribute.

It also introduced a failure mode worth naming, because it fails silently. The category now lives somewhere different inside the tiles, so a new engine runtime against tiles built by the old builder finds no kAdrTunnelCategory records at all. Every ADR tunnel restriction stops being applied, the response shape stays identical including the adr echo, and nothing logs an error. The rule is tiles first, never runtime first, and the gate is qa/benchmarks/adr/adr_audit.py, which asserts a real detour happened and so fails the moment enforcement quietly goes.

What a returned route does not prove

Read this as the product, not the small print. A 200 from an ADR truck route is a routing result, not a legal clearance, and must not be relied on as one.

  • route_certified is always false. Forbidden roads are excluded during the graph search. Nothing inspects the returned geometry against a tunnel inventory afterwards.
  • Enforcement is conditional on data. Roads are excluded only where the graph records an ADR tunnel category, derived from OSM hazmat:* tagging. An untagged categorised tunnel is not excluded, and that response looks exactly like one that was checked.
  • A blanket hazmat=no corridor detours every hazmat load, whatever its declared code, including a (-) load that ADR forbids from nothing.
  • The self-host distro does not apply the code at all. Its compose file pins stock upstream Valhalla, which has no ADR tunnel-category costing and ignores adr_tunnel_code silently while returning the same response shape. Only the hazmat boolean acts. You need an ADR-capable backend: our patch series, or the GraphHopper block.
  • A stale tileset removes enforcement with no error. See the ordering rule.
  • The worst-case reading can over-restrict. Conditional codes are assumed to apply, so a load may be routed around a tunnel it could have used.
  • Height and weight limits have the same gap. UK truck routes on the hosted gateway also carry a restriction_coverage block that grades how well height and weight limits are tagged in each grid cell the route crosses, with its own caveat that the absence of a recorded restriction is not evidence a road was checked. On the Dartford request above, four of the eight cells were graded sparse.
  • The analysis endpoints do not read the adr object. /isochrone and /matrix refuse it with a 400 and take the same constraints in costing_options.truck; /trace_route and /trace_attributes ignore it.

The operator remains responsible for the legality of the movement. We tell you what the map and the ADR 8.6.4 matrix say. We do not certify a vehicle, a load or a journey, and we issue no clearance documents. The duty holder is you and, where one is appointed under ADR 1.8.3, your Dangerous Goods Safety Adviser. Verify the tunnels on a planned route before dispatch.

What this changed in our earlier post

Two sentences, and the post now says so at the top. Our earlier post on ADR tunnel codes carries a correction note dated 9 August 2026 and a second dated 23 September 2026. The first withdraws the claim that a returned route proves the vehicle can legally drive it, and replaces the limitation "no per-response warning field" with the adr_tunnel_enforcement block described here. The second records that the opening paragraph and the costing section still carried the old wording after the first note, and have since been rewritten to say what a returned route proves. The rest of that post, the code table and the worst-case reading, still stands, as does the mechanism argument in why we built our own routing engine and truck routing and vehicle dimensions: constraints are applied inside the search rather than post-filtered.

Try it

Send an ADR truck route and read the block before the polyline. Parameters, backend caveats and limits are on the truck and ADR routing docs page. A key comes from one card-free call to POST /v1/keys.

Routing derives from OpenStreetMap, so credit "© OpenStreetMap contributors" when you render or republish it.