Map Matching Tool
map_matching_toolMatch inaccurate GPS coordinates to the road network, returning clean routes aligned with roads, bike paths, or walkways. Useful for processing recorded trips or fleet tracking data.
Instructions
Snap GPS traces to roads using Mapbox Map Matching API. Takes noisy/inaccurate coordinate sequences (2-100 points) and returns clean routes aligned with actual roads, bike paths, or walkways. Useful for analyzing recorded trips, cleaning fleet tracking data, or processing fitness activity traces. Returns confidence scores, matched geometry, and optional traffic/speed annotations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Routing profile for different modes of transport. Options: - driving: automotive based on road network - driving-traffic: automotive with current traffic conditions - walking: pedestrian/hiking - cycling: bicycle | driving |
| overview | No | Format of the returned geometry. Options: - full: Returns full geometry with all points - simplified: Returns simplified geometry - false: No geometry returned | full |
| radiuses | No | Array of maximum distances (in meters) each coordinate can snap to the road network. If provided, must have the same length as coordinates array. Default is unlimited. Use smaller values (5-25m) for high-quality GPS, larger values (50-100m) for noisy GPS traces. | |
| geometries | No | Format of the returned geometry. Options: - geojson: GeoJSON LineString (recommended) - polyline: Polyline with precision 5 - polyline6: Polyline with precision 6 | geojson |
| timestamps | No | Array of Unix timestamps (in seconds) corresponding to each coordinate. If provided, must have the same length as coordinates array. Used to improve matching accuracy based on speed. | |
| annotations | No | Additional data to include in the response. Options: - speed: Speed limit per segment (km/h) - distance: Distance per segment (meters) - duration: Duration per segment (seconds) - congestion: Traffic level per segment (low, moderate, heavy, severe) | |
| coordinates | Yes | Array of coordinate objects with longitude and latitude properties representing a GPS trace. Must include at least 2 and up to 100 coordinate pairs. Coordinates should be in the order they were recorded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| matchings | Yes | ||
| tracepoints | Yes |