Snap API
GET /v1/snap (parameter)
Snap API matches given GPS point to the nearest road in the road network. Full URL for requests is https://api.strues-maps.lt/v1/snap. Only successful requests are counted towards soft limits and are billed.
Request parameters
point=long,lat
Optional point data as single variable.
point.long=long
Longitude must be supplied in WGS84 projection, also known as EPSG 4326.
point.lat=lat
Latitude must be supplied in WGS84 projection, also known as EPSG 4326.
api_key=your_personal_api_key
Api key is provided after registration. Api key is used for service configuration like soft limits and billing.
Response codes
200 - Successful response
Request was successfully. Response body contains distance and duration of the fastest route between all pairs of supplied coordinates.
400 - Bad request exception
Returned if parameters are not provided or provided in an invalid format.
401 - Unauthorized
Returned if api key is invalid.
429 - Too many requests
Returned if soft limits are reached.
402 - Payment required
Returned if user has insufficient funds to make a request.
500 - Internal server error
Returned if unexpected error has occurred. We are working on it to resolve it.
Response body
{
"code": "Ok",
"waypoints": [
{
"location": [
23.995378,
54.530861
],
"name": "",
"distance": 24.04809,
}
]
}
code - "Ok"
waypoints[i] - array of objects sorted by distance to the input coordinate.
waypoints[i].location[0] - longitude of matching location. Longitude is in WGS84 projection, also known as EPSG 4326.
waypoints[i].location[1] - latitude of matching location. Latitude is in WGS84 projection, also known as EPSG 4326.
waypoints[i].name - name of street the coordinate matched to.
waypoints[i].distance - distance to matching location in meters.
GET /v1/snap (url template)
Snap API matches given GPS point to the nearest road in the road network. Full URL for requests is https://api.strues-maps.lt/v1/snap/{point}. Only successful requests are counted towards soft limits and are billed.
URL template
{point} - long,lat
Point data as single variable. Coordinates must be supplied in WGS84 projection, also known as EPSG 4326.
Request parameters
api_key=your_personal_api_key
Api key is provided after registration. Api key is used for service configuration like soft limits and billing.
GET /v1/snap (polyline)
Snap API matches given GPS point to the nearest road in the road network. Full URL for requests is https://api.strues-maps.lt/v1/snap/polyline({polyline}). Only successful requests are counted towards soft limits and are billed.
URL template
{polyline} - point encoded in polyline format
Polyline encoded longitude and latitude of single point. Coordinates must be supplied in WGS84 projection, also known as EPSG 4326.
Request parameters
api_key=your_personal_api_key
Api key is provided after registration. Api key is used for service configuration like soft limits and billing.