Per-road speeds

🧭 Navigation feature. ZMap snaps every point of your route to its actual road and reads its speed limit from a local database covering all of Europe — then keeps it cached on your phone for offline driving.

The idea

Most navigation apps need a connection to know the speed limit. ZMap does it differently: a per-road speed-limit database is built from OpenStreetMap data and lives on the server. When a route is computed, each trip point is snapped to the nearest road and given its speed. The full route — speeds included — is then cached on the phone: while driving, no network request is needed.

90.5Msampled points
3.6M kmof roads with a known speed
5,104cells of 0.5° × 0.5°
370 MBcompressed grid (gzip)
40 msampling step along roads
5 Bper point (lon, lat, speed)

How it is built

  1. Source: the OpenStreetMap Europe extract (Geofabrik, 34.8 GB) contains 98.2 million roads (highway).
  2. Filtering: osmium tags-filter keeps only the roads (8.5 GB), then only those carrying a speed (maxspeed) are kept — about 13 million.
  3. Sampling: a point is placed every 40 metres along each road, with its speed in km/h.
  4. Indexing: Europe is split into 0.5° cells (≈ 55 km), each subdivided into 32 × 32. Every point is quantized to ≈ 0.76 m and stored in 5 bytes, then the cell is gzip-compressed: 90.5 million points in 370 MB total.

It is fully reproducible: the build script (build_maxspeed.py) runs end to end on a small server.

What is inside

Share of points by speed limit (most common values) :

LimitShare
50 km/h26.2%
30 km/h (30 zones)18.5%
90 km/h9.5%
80 km/h9.2%
70 km/h6.0%
60 km/h5.7%
100 km/h4.6%
40 km/h3.3%
48 km/h (30 mph, UK)2.8%
97 km/h (60 mph, UK)2.4%
32 km/h (20 mph, UK)2.1%
20 km/h (pedestrian zones)2.1%
120 km/h1.8%
130 km/h (motorways)1.7%
110 km/h1.4%

In the app

The server returns, with every route, an array of speeds aligned with the geometry points (one value per point). The phone stores everything in its local cache: while driving, the current section's limit is read without network, and offline mode keeps the whole trip. Snapping a 4,500-point route takes about 170 ms on the server.

Accuracy and coverage

  • Coverage: all of Europe, longitude −12° to 46°, latitude 27° to 72°.
  • Snapping: the nearest road within 40 m of the point.
  • Point location accuracy: ≈ 0.76 m.
  • Data: OpenStreetMap, free (ODbL licence).