Skip to main content

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​

MethodPathPurpose
GET/routing/adapter/nearest/v1/{profile}/{coordinates}Snap a point to the nearest road
POST/routing/adapter/locateGet 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

ParameterInTypeRequiredDescriptionExample
profilepathstringYesRouting profile. The example uses car.car
coordinatespathstringYesPoint 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
}
]
}
FieldTypeDescription
codestringOk on success.
waypointsarrayThe snapped point.
waypoints[]object
waypoints[].nodesarrayInternal road-graph node IDs.
waypoints[].nodes[]integer
waypoints[].hintstringInternal hint. Ignore it.
waypoints[].locationarraySnapped position on the road, [longitude, latitude].
waypoints[].location[]number
waypoints[].namestringName of the road.
waypoints[].distancenumberDistance 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

ParameterInTypeRequiredDescriptionExample
locationsbodyarrayNoPoints to look up.
locations[]bodyobjectNo
locations[].latbodynumberNoLatitude of the point, decimal degrees.
locations[].lonbodynumberNoLongitude of the point, decimal degrees.
verbosebodybooleanNotrue 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": []
}
]
}
]
FieldTypeDescription
[]objectOne entry per input point.
[].input_lonnumberLongitude you sent.
[].nodesarray
[].input_latnumberLatitude you sent.
[].edgesarrayRoad segments near the point.
[].edges[]object
[].edges[].access_restrictionsarray
[].edges[].live_speedobject
[].edges[].correlated_lonnumberLongitude of the point snapped onto this segment.
[].edges[].side_of_streetstring
[].edges[].linear_referencestring
[].edges[].percent_alongnumber
[].edges[].outbound_reachinteger
[].edges[].distancenumberDistance from the input point to the segment, metres.
[].edges[].edge_infoobject
[].edges[].edge_info.speed_limitintegerPosted speed limit. 0 when unknown.
[].edges[].edge_info.mean_elevationstring
[].edges[].edge_info.shapestring
[].edges[].edge_info.namesarrayRoad names of the segment.
[].edges[].edge_info.bike_networkobject
[].edges[].edge_info.bike_network.mountainboolean
[].edges[].edge_info.bike_network.localboolean
[].edges[].edge_info.bike_network.regionalboolean
[].edges[].edge_info.bike_network.nationalboolean
[].edges[].edge_info.way_idinteger
[].edges[].edgeobject
[].edges[].edge.bridgeboolean
[].edges[].edge.accessobjectWhich travel modes may use the segment.
[].edges[].edge.access.truckboolean
[].edges[].edge.access.pedestrianboolean
[].edges[].edge.access.wheelchairboolean
[].edges[].edge.access.taxiboolean
[].edges[].edge.access.HOVboolean
[].edges[].edge.access.emergencyboolean
[].edges[].edge.access.motorcycleboolean
[].edges[].edge.access.carboolean
[].edges[].edge.access.mopedboolean
[].edges[].edge.access.busboolean
[].edges[].edge.access.bicycleboolean
[].edges[].edge.has_signboolean
[].edges[].edge.deadendboolean
[].edges[].edge.country_crossingboolean
[].edges[].edge.tunnelboolean
[].edges[].edge.seasonalboolean
[].edges[].edge.end_restrictionobject
[].edges[].edge.end_restriction.truckboolean
[].edges[].edge.end_restriction.pedestrianboolean
[].edges[].edge.end_restriction.wheelchairboolean
[].edges[].edge.end_restriction.taxiboolean
[].edges[].edge.end_restriction.HOVboolean
[].edges[].edge.end_restriction.emergencyboolean
[].edges[].edge.end_restriction.motorcycleboolean
[].edges[].edge.end_restriction.carboolean
[].edges[].edge.end_restriction.mopedboolean
[].edges[].edge.end_restriction.busboolean
[].edges[].edge.end_restriction.bicycleboolean
[].edges[].edge.cycle_lanestring
[].edges[].edge.start_restrictionobject
[].edges[].edge.start_restriction.truckboolean
[].edges[].edge.start_restriction.pedestrianboolean
[].edges[].edge.start_restriction.wheelchairboolean
[].edges[].edge.start_restriction.taxiboolean
[].edges[].edge.start_restriction.HOVboolean
[].edges[].edge.start_restriction.emergencyboolean
[].edges[].edge.start_restriction.motorcycleboolean
[].edges[].edge.start_restriction.carboolean
[].edges[].edge.start_restriction.mopedboolean
[].edges[].edge.start_restriction.busboolean
[].edges[].edge.start_restriction.bicycleboolean
[].edges[].edge.geo_attributesobject
[].edges[].edge.geo_attributes.curvatureinteger
[].edges[].edge.geo_attributes.max_down_slopeinteger
[].edges[].edge.geo_attributes.max_up_slopeinteger
[].edges[].edge.geo_attributes.weighted_gradeinteger
[].edges[].edge.geo_attributes.lengthinteger
[].edges[].edge.part_of_complex_restrictionboolean
[].edges[].edge.access_restrictionboolean
[].edges[].edge.traffic_signalboolean
[].edges[].edge.tollbooleantrue on a toll road.
[].edges[].edge.round_aboutboolean
[].edges[].edge.bike_networkboolean
[].edges[].edge.speedsobject
[].edges[].edge.speeds.predictedboolean
[].edges[].edge.speeds.constrained_flowinteger
[].edges[].edge.speeds.free_flowinteger
[].edges[].edge.speeds.typestring
[].edges[].edge.speeds.defaultinteger
[].edges[].edge.truck_routeboolean
[].edges[].edge.end_nodeobject
[].edges[].edge.end_node.valueinteger
[].edges[].edge.end_node.idinteger
[].edges[].edge.end_node.tile_idinteger
[].edges[].edge.end_node.levelinteger
[].edges[].edge.not_thruboolean
[].edges[].edge.destination_onlyboolean
[].edges[].edge.yield_signboolean
[].edges[].edge.classificationobject
[].edges[].edge.classification.internalboolean
[].edges[].edge.classification.linkboolean
[].edges[].edge.classification.surfacestring
[].edges[].edge.classification.usestringWhat the road is used for, e.g. service_road.
[].edges[].edge.classification.classificationstring
[].edges[].edge.sac_scalestring
[].edges[].edge.forwardboolean
[].edges[].edge.stop_signboolean
[].edges[].edge.lane_countintegerNumber of lanes.
[].edges[].edge.sidewalk_rightboolean
[].edges[].edge.sidewalk_leftboolean
[].edges[].headingnumber
[].edges[].inbound_reachinteger
[].edges[].correlated_latnumberLatitude of the point snapped onto this segment.
[].edges[].edge_idobject
[].edges[].edge_id.valueinteger
[].edges[].edge_id.idinteger
[].edges[].edge_id.tile_idinteger
[].edges[].edge_id.levelinteger
[].edges[].predicted_speedsarray

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'