Snap to Road API
Clean, filter, and map-match noisy GPS traces to exact road networks and lane geometries.
Overview & Solution
Mobile GPS signals in dense urban canyons or under adverse weather conditions suffer from drift, jumping across buildings and parallel streets. The Snap to Road API reconstructs the true driving trajectory from a noisy GPS trace, eliminating jitter and attaching road metadata (speed limits, one-way constraints).
Industry Use Cases
1. Insurance Telematics & Driver Behavior
- Speed Limit Violation Audits: Correlate vehicle speed pings with the exact snapped road segment's posted speed limit to score driver risk.
2. Distance Billing & Fare Verification
- Taxi & Logistics Auditing: Compute actual road kilometers traveled for accurate fare settlement, preventing overbilling or underbilling.
3. Historical Route Playback
- Operations Control Centers: Render smooth, realistic animated vehicle playback on control maps.
API reference
Route and Journey Intelligence APIs · API key only
Endpoints
| Method | Path | Purpose |
|---|---|---|
GET | /routing/adapter/nearest/v1/{profile}/{coordinates} | Snap a point to the nearest road |
POST | /routing/adapter/locate | Get road details at a point |
All requests need only your API key, as the api-key query parameter - no bearer token:
?api-key=<apiKey>
Snap a point to the nearest road
GET /routing/adapter/nearest/v1/{profile}/{coordinates}
Base URL: https://api-gw.sovereignsolutions.com/gateway
Request Parameters
| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
profile | path | string | Yes | Routing profile. The example uses car. | car |
coordinates | path | string | Yes | Point to snap, as lon,lat. | 72.8460,19.0806 |
Response Schema
200 OK
{
"code": "Ok",
"waypoints": [
{
"nodes": [
245668413,
245668413
],
"hint": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"location": [
72.846003,
19.080533
],
"name": "Station Road",
"distance": 3.666487744
}
]
}
| Field | Type | Description |
|---|---|---|
code | string | Ok on success. |
waypoints | array | The snapped point. |
waypoints[] | object | |
waypoints[].nodes | array | Internal road-graph node IDs. |
waypoints[].nodes[] | integer | |
waypoints[].hint | string | Internal hint. Ignore it. |
waypoints[].location | array | Snapped position on the road, [longitude, latitude]. |
waypoints[].location[] | number | |
waypoints[].name | string | Name of the road. |
waypoints[].distance | number | Distance from the input point to the snapped position, metres. |
Get road details at a point
POST /routing/adapter/locate
Base URL: https://api-gw.sovereignsolutions.com/gateway
Request Parameters
| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
locations | body | array | No | Points to look up. | |
locations[] | body | object | No | ||
locations[].lat | body | number | No | Latitude of the point, decimal degrees. | |
locations[].lon | body | number | No | Longitude of the point, decimal degrees. | |
verbose | body | boolean | No | true returns the full road attributes. |
Request body
{
"locations": [
{
"lat": 19.0829,
"lon": 72.8455
}
],
"verbose": true
}
Response Schema
200 OK
[
{
"input_lon": 72.8455,
"nodes": [],
"input_lat": 19.0829,
"edges": [
{
"access_restrictions": [],
"live_speed": {},
"correlated_lon": 72.845463,
"side_of_street": "neither",
"linear_reference": "KzPNHA2R7HrgAAADAA46UJc=",
"percent_along": 0.59093,
"outbound_reach": 50,
"distance": 3.9,
"edge_info": {
"speed_limit": 0,
"mean_elevation": null,
"shape": "qkvkc@qhc}iCxFJ",
"names": [],
"bike_network": {
"mountain": false,
"local": false,
"regional": false,
"national": false
},
"way_id": 1487977608
},
"edge": {
"bridge": false,
"access": {
"truck": true,
"pedestrian": true,
"wheelchair": true,
"taxi": true,
"HOV": true,
"emergency": false,
"motorcycle": true,
"car": true,
"moped": true,
"bus": true,
"bicycle": true
},
"has_sign": false,
"deadend": false,
"country_crossing": false,
"tunnel": false,
"seasonal": false,
"end_restriction": {
"truck": false,
"pedestrian": false,
"wheelchair": false,
"taxi": false,
"HOV": false,
"emergency": false,
"motorcycle": false,
"car": false,
"moped": false,
"bus": false,
"bicycle": false
},
"cycle_lane": "none",
"start_restriction": {
"truck": false,
"pedestrian": false,
"wheelchair": false,
"taxi": false,
"HOV": false,
"emergency": false,
"motorcycle": false,
"car": false,
"moped": false,
"bus": false,
"bicycle": false
},
"geo_attributes": {
"curvature": 0,
"max_down_slope": 0,
"max_up_slope": 0,
"weighted_grade": 0,
"length": 14
},
"part_of_complex_restriction": false,
"access_restriction": false,
"traffic_signal": false,
"toll": false,
"round_about": false,
"bike_network": false,
"speeds": {
"predicted": false,
"constrained_flow": 0,
"free_flow": 0,
"type": "classified",
"default": 20
},
"truck_route": false,
"end_node": {
"value": 982109701018,
"id": 29269,
"tile_id": 628851,
"level": 2
},
"not_thru": false,
"destination_only": true,
"yield_sign": false,
"classification": {
"internal": false,
"link": false,
"surface": "paved_smooth",
"use": "service_road",
"classification": "service_other"
},
"sac_scale": "none",
"forward": false,
"stop_sign": false,
"lane_count": 1,
"sidewalk_right": false,
"sidewalk_left": false
},
"heading": 2.6,
"inbound_reach": 50,
"correlated_lat": 19.082902,
"edge_id": {
"value": 2123597923226,
"id": 63288,
"tile_id": 628851,
"level": 2
},
"predicted_speeds": []
}
]
}
]
| Field | Type | Description |
|---|---|---|
[] | object | One entry per input point. |
[].input_lon | number | Longitude you sent. |
[].nodes | array | |
[].input_lat | number | Latitude you sent. |
[].edges | array | Road segments near the point. |
[].edges[] | object | |
[].edges[].access_restrictions | array | |
[].edges[].live_speed | object | |
[].edges[].correlated_lon | number | Longitude of the point snapped onto this segment. |
[].edges[].side_of_street | string | |
[].edges[].linear_reference | string | |
[].edges[].percent_along | number | |
[].edges[].outbound_reach | integer | |
[].edges[].distance | number | Distance from the input point to the segment, metres. |
[].edges[].edge_info | object | |
[].edges[].edge_info.speed_limit | integer | Posted speed limit. 0 when unknown. |
[].edges[].edge_info.mean_elevation | string | |
[].edges[].edge_info.shape | string | |
[].edges[].edge_info.names | array | Road names of the segment. |
[].edges[].edge_info.bike_network | object | |
[].edges[].edge_info.bike_network.mountain | boolean | |
[].edges[].edge_info.bike_network.local | boolean | |
[].edges[].edge_info.bike_network.regional | boolean | |
[].edges[].edge_info.bike_network.national | boolean | |
[].edges[].edge_info.way_id | integer | |
[].edges[].edge | object | |
[].edges[].edge.bridge | boolean | |
[].edges[].edge.access | object | Which travel modes may use the segment. |
[].edges[].edge.access.truck | boolean | |
[].edges[].edge.access.pedestrian | boolean | |
[].edges[].edge.access.wheelchair | boolean | |
[].edges[].edge.access.taxi | boolean | |
[].edges[].edge.access.HOV | boolean | |
[].edges[].edge.access.emergency | boolean | |
[].edges[].edge.access.motorcycle | boolean | |
[].edges[].edge.access.car | boolean | |
[].edges[].edge.access.moped | boolean | |
[].edges[].edge.access.bus | boolean | |
[].edges[].edge.access.bicycle | boolean | |
[].edges[].edge.has_sign | boolean | |
[].edges[].edge.deadend | boolean | |
[].edges[].edge.country_crossing | boolean | |
[].edges[].edge.tunnel | boolean | |
[].edges[].edge.seasonal | boolean | |
[].edges[].edge.end_restriction | object | |
[].edges[].edge.end_restriction.truck | boolean | |
[].edges[].edge.end_restriction.pedestrian | boolean | |
[].edges[].edge.end_restriction.wheelchair | boolean | |
[].edges[].edge.end_restriction.taxi | boolean | |
[].edges[].edge.end_restriction.HOV | boolean | |
[].edges[].edge.end_restriction.emergency | boolean | |
[].edges[].edge.end_restriction.motorcycle | boolean | |
[].edges[].edge.end_restriction.car | boolean | |
[].edges[].edge.end_restriction.moped | boolean | |
[].edges[].edge.end_restriction.bus | boolean | |
[].edges[].edge.end_restriction.bicycle | boolean | |
[].edges[].edge.cycle_lane | string | |
[].edges[].edge.start_restriction | object | |
[].edges[].edge.start_restriction.truck | boolean | |
[].edges[].edge.start_restriction.pedestrian | boolean | |
[].edges[].edge.start_restriction.wheelchair | boolean | |
[].edges[].edge.start_restriction.taxi | boolean | |
[].edges[].edge.start_restriction.HOV | boolean | |
[].edges[].edge.start_restriction.emergency | boolean | |
[].edges[].edge.start_restriction.motorcycle | boolean | |
[].edges[].edge.start_restriction.car | boolean | |
[].edges[].edge.start_restriction.moped | boolean | |
[].edges[].edge.start_restriction.bus | boolean | |
[].edges[].edge.start_restriction.bicycle | boolean | |
[].edges[].edge.geo_attributes | object | |
[].edges[].edge.geo_attributes.curvature | integer | |
[].edges[].edge.geo_attributes.max_down_slope | integer | |
[].edges[].edge.geo_attributes.max_up_slope | integer | |
[].edges[].edge.geo_attributes.weighted_grade | integer | |
[].edges[].edge.geo_attributes.length | integer | |
[].edges[].edge.part_of_complex_restriction | boolean | |
[].edges[].edge.access_restriction | boolean | |
[].edges[].edge.traffic_signal | boolean | |
[].edges[].edge.toll | boolean | true on a toll road. |
[].edges[].edge.round_about | boolean | |
[].edges[].edge.bike_network | boolean | |
[].edges[].edge.speeds | object | |
[].edges[].edge.speeds.predicted | boolean | |
[].edges[].edge.speeds.constrained_flow | integer | |
[].edges[].edge.speeds.free_flow | integer | |
[].edges[].edge.speeds.type | string | |
[].edges[].edge.speeds.default | integer | |
[].edges[].edge.truck_route | boolean | |
[].edges[].edge.end_node | object | |
[].edges[].edge.end_node.value | integer | |
[].edges[].edge.end_node.id | integer | |
[].edges[].edge.end_node.tile_id | integer | |
[].edges[].edge.end_node.level | integer | |
[].edges[].edge.not_thru | boolean | |
[].edges[].edge.destination_only | boolean | |
[].edges[].edge.yield_sign | boolean | |
[].edges[].edge.classification | object | |
[].edges[].edge.classification.internal | boolean | |
[].edges[].edge.classification.link | boolean | |
[].edges[].edge.classification.surface | string | |
[].edges[].edge.classification.use | string | What the road is used for, e.g. service_road. |
[].edges[].edge.classification.classification | string | |
[].edges[].edge.sac_scale | string | |
[].edges[].edge.forward | boolean | |
[].edges[].edge.stop_sign | boolean | |
[].edges[].edge.lane_count | integer | Number of lanes. |
[].edges[].edge.sidewalk_right | boolean | |
[].edges[].edge.sidewalk_left | boolean | |
[].edges[].heading | number | |
[].edges[].inbound_reach | integer | |
[].edges[].correlated_lat | number | Latitude of the point snapped onto this segment. |
[].edges[].edge_id | object | |
[].edges[].edge_id.value | integer | |
[].edges[].edge_id.id | integer | |
[].edges[].edge_id.tile_id | integer | |
[].edges[].edge_id.level | integer | |
[].edges[].predicted_speeds | array |
The example response is shortened to the first road segment.
Example
curl -X GET 'https://api-gw.sovereignsolutions.com/gateway/routing/adapter/nearest/v1/car/72.8460,19.0806?api-key=$API_KEY'