# Map matching: GPS traces snapped to the road

> /trace-route turns a noisy GPS trace into the route the vehicle drove; /trace-attributes returns the roads under it with their attributes (names, speeds, road class). On Berlin the responses were byte-identical to Valhalla 3.9.1 on 160/160 trace requests, with traces made from reference routes: points every 10 to 50 m with 5 to 15 m of noise, some sparse, some with a gap.

Status: In development, not deployed: there is no routing endpoint to call yet, on geolith.app or api.geolith.app, and no routing plan, price or key.

## Map matching (/trace-route and /trace-attributes) against Valhalla 3.9.1, Berlin

| Set | Requests | Byte-identical |
| --- | --- | --- |
| Trace requests | 160 | 160/160 |

## Request

shape is the trace as a list of points; costing is auto, pedestrian or bicycle; shape_match is map_snap, edge_walk or walk_or_snap, as in Valhalla. The paths are kebab-case: Valhalla’s /trace_route and /trace_attributes are /trace-route and /trace-attributes here.

Request shape (no hosted endpoint):

```bash
curl -X POST "https://ROUTER_HOST/trace-attributes" \
  -H "Content-Type: application/json" \
  -d '{
    "shape": [
      { "lat": 52.5163, "lon": 13.3777 },
      { "lat": 52.5150, "lon": 13.3690 },
      { "lat": 52.5120, "lon": 13.3550 }
    ],
    "costing": "auto",
    "shape_match": "map_snap"
  }'
```

## Uses

Clean up fleet GPS before computing distance driven, label a trip with the roads it used, or turn your drivers’ pings into per-road speeds for traffic.

## Sources

1. [Routing API (planned)](https://docs.geolith.app/routing/api), geolith docs (read 2026-11-08)
2. [Valhalla turn-by-turn API reference](https://valhalla.github.io/valhalla/api/turn-by-turn/api-reference/), Valhalla (open source, MIT) (read 2026-11-08)

Routing is in development and not deployed; there is no endpoint to call yet, and no routing plan, price or key. Read the routing docs: https://docs.geolith.app/routing
