Skip to content
news / pedestrian-routing-profiles · raw .md
RoutingUpdated 8 min readMapMap engineering
Three overlapping walking paths traced between the same two points across a sparse street lattice, one detouring around a stepped block, one hugging a run of marked lamp positions, one climbing into contour lines.

Pedestrian costing is not one walking profile

MapMap's pedestrian costing takes options that change which pavements, crossings and paths a walking route is allowed to use: use_lit (0 to 1, a preference for lit streets), type (foot, wheelchair or blind), max_hiking_difficulty (OSM sac_scale, 1 to 6) and use_hills (0 to 1, how hard to avoid climbs). They are applied inside the search, not as a filter over a finished route, so the route that comes back is already the one that respects them. The shortest path for an able-bodied adult in daylight is not the path a wheelchair user needs, and it is not the path someone walking home at 11pm wants either. Those are different costings, not different post-processing.

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

What does the pedestrian costing actually accept?

Six fields, all optional, all under costing_options.pedestrian. The first three are the routing engine's own; the last three are read by our gateway and were added at the end of September.

FieldTypeValuesDefault
use_litnumber0.0 to 1.0, where 1.0 prefers lit ways as strongly as possible0 (no lighting preference)
typestringfoot, wheelchair or blindfoot
max_hiking_difficultyinteger1 to 6, the OSM sac_scale cap1
use_hillsnumber0.0 to 1.0, where 0 avoids climbs as strongly as the engine canengine default (0.5); 0 on a wheelchair route that omits it
max_grade_pctintegerwhole percent, 1 to 90none
surface_qualitystringavoid or ignore, wheelchair onlyavoid where a surface graph covers the route

Two of those come with a caveat in the response itself. max_grade_pct is accepted and passed to the engine, which does not enforce it yet, and the route's grade.cap block says so rather than letting you believe a cap was applied. surface_quality steers wheelchair routes away from ways OpenStreetMap rates bad or worse for smoothness, using a second graph that today covers Estonia only; outside it the route carries "surface_quality": {"applied": false, "reason": "outside_coverage"}.

On the compatible URL endpoint the engine's three options are vendor query parameters: use_lit, pedestrian_type and max_hiking_difficulty, and they require the walking profile. That endpoint checks every value before routing. max_hiking_difficulty=7 returns max_hiking_difficulty must be an integer between 1 and 6 (OSM sac_scale, got "7"), an unknown pedestrian_type returns pedestrian_type must be wheelchair or blind, and the same parameters on any other profile return walking vendor extensions (use_lit/pedestrian_type/max_hiking_difficulty) require the walking profile, because a lit-street preference on a lorry is a bug in your caller, not something to silently drop.

POST /route checks the three gateway fields the same way: use_hills: 1.5 returns costing_options.pedestrian.use_hills must be a number between 0 and 1 (got 1.5), and surface_quality: "avoid" on a foot route is refused because the foot profile accepts every surface. It does not yet check the engine's own three, which is in the limits below.

How do you ask for a lit route home?

Set use_lit=1 on the walking profile. GET /route/v1 is on the keyless demo lane, so this runs as it stands, with no key:

sh
curl -fsS "https://api.mapmap.ai/route/v1/walking/-0.1278,51.5074;-0.1420,51.5010?steps=true&use_lit=1"

The response is OSRM-shaped, so anything that already speaks OSRM parses it unchanged. Trimmed to the fields that matter here, captured on 25 November 2026:

json
{
  "code": "Ok",
  "routes": [
    {
      "distance": 1250.0,
      "duration": 969.146,
      "weight": 969.146,
      "weight_name": "duration",
      "legs": [
        { "distance": 1250.0, "duration": 969.146, "summary": "The Mall, Charing Cross" }
      ]
    }
  ]
}

Distances are metres, durations are seconds. That route, from Trafalgar Square to Buckingham Gate, is the same with and without use_lit=1, so on this pair the lighting preference was not binding: the shortest walk is already one the router has no better-lit alternative to. Add pedestrian_type=wheelchair and the same 1,250 m comes back at 1,227 s, because the wheelchair profile moves more slowly.

On the POST /route body the same request is a typed object, and POST /route needs a key:

json
{
  "locations": [
    { "lat": 51.5074, "lon": -0.1278 },
    { "lat": 51.5010, "lon": -0.1420 }
  ],
  "costing": "pedestrian",
  "costing_options": {
    "pedestrian": { "use_lit": 1.0, "type": "wheelchair", "max_hiking_difficulty": 2 }
  }
}

As a wheelchair route that omits use_hills, it is sent use_hills: 0, and the answer changes shape: 1,310 m and 1,269 s instead of 1,251 m on foot, plus a grade block reporting the climb the route still has, measured against a 30 m elevation model:

json
"grade": {
  "max_grade_pct": 16.7,
  "total_ascent_m": 33.3,
  "total_descent_m": 32.1,
  "preference": { "source": "wheelchair_default", "use_hills": 0.0 },
  "cap": null,
  "dem": { "dataset": "mapzen-terrain-tiles", "resolution_m": 30.0 },
  "coverage_fraction": 1.0
}

The block also carries a caveat string, which says that kerb ramps, short steep ramps, steps and dropped kerbs smaller than the model's cell are invisible to it. A 16.7 per cent sample over 10 m is a fact about the elevation model, not a survey of the pavement.

Pedestrian routing bills at the Standard class: 0.05p per call from the 50,001st call of the month, after a free tier of 50,000 calls a month that allows commercial use. There is no accessibility surcharge, because charging more for a wheelchair route would be an indefensible thing to put on a price list.

What does the wheelchair profile key off in OpenStreetMap?

The wheelchair type avoids steps, kerbs and steep grades where those are mapped, and every one of those three facts is an OpenStreetMap tag that a human being had to survey and type in.

Fact the profile needsOSM tagNotes
Is this a flight of stepshighway=steps, step_countstep_count is the number of steps
Can a wheelchair cross herekerb=flush|lowered|no|raised|rolled|yes, kerb:heightflush, lowered and no imply wheelchair access; raised, rolled and the generic yes imply not
Is this way itself accessiblewheelchair=yes|limited|designated|noThe OSM wiki states there is no default value, so an untagged way asserts nothing
How steep is itinclinePercentage or up/down
Will the wheels copesurface, smoothnessCobbles and loose gravel are surface facts, not grade facts

The hiking cap keys off a different tag entirely. sac_scale is the Swiss Alpine Club six-point scale: T1 hiking, T2 mountain hiking, T3 demanding mountain hiking, T4 alpine hiking, T5 demanding alpine hiking, T6 difficult alpine hiking. Our default of 1 means a walking route will not send you up a T2 path unless you raise the cap, which is the right default for a city routing API and the wrong one for a walking-holiday app. That is why it is a parameter.

Why put this in costing rather than in a filter?

Because a filter can only reject a route, and rejecting is not the same as finding a better one. If you compute the shortest walking route and then drop it because it crosses a raised kerb, you have no route. If the search itself knows the kerb is raised, it can go 30 metres further along and use the dropped-kerb crossing, and you get a route a wheelchair can actually take. The same holds for the areas these profiles feed: a walking isochrone computed with type: wheelchair is a different shape from one on foot, and post-filtering cannot produce that shape at all.

How do you know the profile actually changed the route?

Add "rationale": true to a POST /route request and the response gains a block naming which declared options changed the route and where; why this route covers the method in full. For pedestrian costing the typed kinds are unlit_street_avoided, hiking_difficulty_limited, ferry_avoided, living_street_avoided and access_profile, the last being a type other than foot.

The method is route divergence: the gateway re-routes with each declared field relaxed and compares the geometry. The baselines are chosen per field type, because honesty demands it. A preference such as use_lit is removed so the engine default applies, reported as baseline: "engine_default". A hard cap such as max_hiking_difficulty is relaxed to its explicit maximum of 6, reported as baseline: "cap_lifted", because the engine's own default of 1 is itself restrictive and removing the field would tighten the probe rather than loosen it.

It is opt-in, and it is metered by the engine computations it performs, one unit of the call's price class each, at most 8 and typically fewer. That makes it an audit tool rather than something to leave on. The full contract is in the why this route section of the API reference. It proves a field was binding and where the routes part ways. It does not identify the physical feature: not the specific unlit street, not the individual step.

What this does not do

These profiles are only as good as OpenStreetMap's accessibility tagging, and that tagging is sparse and uneven. As of August 2026, taginfo counts roughly 266 million ways carrying highway, against 15.2 million objects with lit, 3.0 million with kerb, 1.7 million with incline, 0.9 million with sac_scale and 517,000 with step_count. Put two of those side by side and the gap is stark: there are 13.4 million highway=crossing nodes and 3.0 million kerb tags, and 2.1 million highway=steps ways against 517,000 step_count values.

So state the limit plainly. A type: wheelchair route through an undertagged area is a best effort over incomplete data. It is not an accessibility guarantee, it is not a survey, and it is not a certification. Do not present it to an end user as one, do not use it as the sole basis for telling someone a journey is possible, and do not build a compliance claim on it. Every field here is a preference weight or a classifier, never a promise. Where the data is silent, the router routes as if the obstacle is not there, because from the graph's point of view it is not.

use_lit has the same shape of limit and one extra wrinkle. The router can only prefer ways that OpenStreetMap records as lit, so on a street with no lit tag there is nothing to prefer. Unlit ways are still used when no lit alternative exists, which is the correct behaviour (a route home beats no route home) but it means a strong use_lit and a normal walking route can be the same geometry in an untagged neighbourhood. That case is detectable rather than mysterious: ask for rationale: true, and if nothing was binding the response says so instead of inventing a reason.

Three operational limits worth knowing. POST /route passes use_lit, type and max_hiking_difficulty to the engine without checking them: on 25 November 2026 a body with max_hiking_difficulty: 7 and one with type: "hoverboard" both came back as the ordinary foot route, with no error. Until the gateway checks them, check them in your caller, or use the URL endpoint, which refuses both. max_grade_pct is not enforced by the engine yet, and the grade.cap block says so. And the blind type changes guidance detail rather than adding a hazard database, so it pairs with turn-by-turn instructions rather than replacing what a screen reader or a white cane already tells you.

Try it

Route the same pair of points twice on the keyless URL endpoint, once with pedestrian_type=wheelchair and once without, and diff the geometry. For POST /route and the grade block, the quickstart has the key-issuing call and the shell setup. If the two routes are identical, that is a fact about the tagging where you are, and it is worth knowing before you ship.