The offline router (offline/router.ts) produces good driving directions on real San Francisco tiles. It is still simpler than a real routing engine.
Known gaps
- No turn costs: A* runs on nodes, so a left turn costs the same as going straight. Apple-like routes prefer fewer turns. Switch to edge-based search with turn penalties by angle, and U-turn penalties.
- No turn restrictions: OpenMapTiles tiles don't carry OSM turn-restriction relations, so "no left turn" is ignored. Document this, and consider an optional restrictions sidecar in downloads.
- Walking directions are noisy: sidewalks and crossings mapped as separate unnamed footways produce many small "Turn right" steps. Some are merged already (
tidySteps), but more work is needed: snap sidewalks to their street, and treat crossings as part of the street. - Access tags: private/service roads,
access=noand pedestrian zones aren't in the tiles, so the router may route through them. - No lane guidance offline: steps carry no
lanes. Lane data isn't in OMT tiles. - Timing: junction delays are a flat per-profile constant. Consider class-dependent delays and traffic-signal nodes if the data allows.
Add regression fixtures from real tiles (small extracts) for each fix.