Map Matching API
OpenAPI Specification
2GIS Navigation API (6.0.0)
Reconstruct a route
Snaps noisy GPS traces to the road network, returning a reconstructed route.
query Parameters
key required | string Developer API key |
Request Body schema: */*required
Request parameters
required | Array of objects (QueryPoint) An array of points for the route. |
boolean or null If true, speed limits will be added to the sections of the constructed route. |
Responses
Response Schema: application/json
distance required | number <double> Length of the reconstructed route in meters |
duration required | number Duration of the reconstructed route in seconds. |
required | Array of objects (MatchedEdges) |
required | Array of objects (MatchedQueryPoint) |
route required | string Geometry of the reconstructed route in WKT format. |
status required | string (Status) Enum: "OK" "FAIL" Was the route successfully reconstructed:
|
Response samples
- 200
- 400
Content type
application/json
{- "distance": 60.494,
- "duration": 5,
- "edges": [
- {
- "distance": 96.268,
- "edge_id": 282909495821411,
- "geometry": "LINESTRING(82.914962 55.05097,82.914834 55.05146)",
- "speed_limit": 60
}
], - "query": [
- {
- "azimuth": 171,
- "edge_id": 282909495821411,
- "lat": 55.051097,
- "lat_matched": 55.051095,
- "lon": 82.914948,
- "lon_matched": 82.914929,
- "speed": 41,
- "utc": 1623878771
}, - {
- "azimuth": 171,
- "edge_id": 282909495821411,
- "lat": 55.051196,
- "lat_matched": 55.051195,
- "lon": 82.914914,
- "lon_matched": 82.914903,
- "speed": 42,
- "utc": 1623878773
}, - {
- "azimuth": 171,
- "edge_id": 282909495821411,
- "lat": 55.051289,
- "lat_matched": 55.051288,
- "lon": 82.914885,
- "lon_matched": 82.914879,
- "speed": 43.3,
- "utc": 1623878775
}, - {
- "azimuth": 171,
- "edge_id": 282909495821411,
- "lat": 55.051404,
- "lat_matched": 55.051403,
- "lon": 82.914866,
- "lon_matched": 82.914849,
- "speed": 42,
- "utc": 1623878776
}
], - "route": "LINESTRING(82.914929 55.051096,82.914849 55.051403)",
- "status": "OK"
}