Synchronous Snap to Roads

Service version: 1
Last edit: 2023.05.26

Purpose

The Synchronous Snap to Roads endpoint provides detailed information of a reconstructed road in an efficient way. The Snap to Roads endpoint matches the received points to the map road network and reconstructs the driven road. Points given as input to the Snap to Roads endpoint are related to themselves and are a part of the same route from the same client.

The matching algorithm chooses the driven road fitting to all of the given points, or in case of a few possibilities takes into account additional restrictions provided by the client. This endpoint can also provide extended data related to a matched route. This endpoint can be used for:

  • Reconstructing the driven road and getting the detailed insights for it.
  • Providing innovative information in order to build applications with advanced map data.

Run this endpoint

You can easily run this and other endpoints. Go to the TomTom API Explorer and follow the directions.

Request data

HTTPS method: GET

For ease of viewing and identification:

  • Constants and parameters enclosed in curly brackets { } must be replaced with their values.
  • Please see the following GET request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
get
URL request format
https://{baseURL}/snapToRoads/{versionNumber}?key={Your_API_Key}&points={longitude,latitude...}&headings={string}&timestamps={string}&fields={string}&vehicleType={string}&measurementSystem={string}
get
URL request example (only speed limits)
https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&points=4.6104919036936565,52.37576529649988;4.614096792595859,52.38341473290629&headings=0;0&timestamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={route{properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto
get
curl command request example (only speed limits)
curl 'https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&points=4.6104919036936565,52.37576529649988;4.614096792595859,52.38341473290629&headings=0;0&timestamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={route{properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto'
get
URL request example (projected points and road elements with geometry, speed limits, and IDs)
https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&points=4.6104919036936565,52.37576529649988;4.614096792595859,52.38341473290629&headings=0;0&timestamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto&offroadMargin=50
get
curl command request example (projected points and road elements with geometry, speed limits, and IDs)
curl 'https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&points=4.6104919036936565,52.37576529649988;4.614096792595859,52.38341473290629<&headings=0;0&timestamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto&offroadMargin=50'
get
URL request example (all possible data))
https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&points=4.6104919036936565,52.37576529649988;4.614096792595859,52.38341473290629&headings=0;0&timestamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,linearReference,speedLimits{value,unit,type},speedProfile{value,unit},address{roadName,roadNumbers,municipality,countryName,countryCode,countrySubdivision},maximumDimensions{height{value,unit},length{value,unit},width{value,unit},totalWeight{value,unit},weightPerAxle{value,unit}},traveledDistance{value,unit},privateRoad,partOfTunnel,urbanArea,elementType,frc,formOfWay,roadUse,laneInfo{numberOfLanes},heightInfo{height,chainage,unit},trafficSigns{signType,chainage,unit},trafficLight,confidence,emissionRegulations{restrictionType,emissionClass,engineType}}},distances{total,ferry,publicRoad,privateRoad,road,offRoad,unit}}&vehicleType=PassengerCar&measurementSystem=auto&offroadMargin=50
get
curl command request example (all possible data)
curl 'https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&points=4.6104919036936565,52.37576529649988;4.614096792595859,52.38341473290629&headings=0;0&timestamps=2021-01-01T00:00:00Z;2021-01-01T00:01:00Z&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,speedLimits{value,unit,type},speedProfile{value,unit},address{roadName,roadNumbers,municipality,countryName,countryCode,countrySubdivision},maximumDimensions{height{value,unit},length{value,unit},width{value,unit},totalWeight{value,unit},weightPerAxle{value,unit}},traveledDistance{value,unit},privateRoad,partOfTunnel,urbanArea,elementType,frc,formOfWay,roadUse,laneInfo{numberOfLanes},heightInfo{height,chainage,unit},trafficSigns{signType,chainage,unit},trafficLight,confidence,emissionRegulations{restrictionType,emissionClass,engineType}}},distances{total,ferry,publicRoad,privateRoad,road,offRoad,unit}}&vehicleType=PassengerCar&measurementSystem=auto&offroadMargin=50'

GET request parameters

The following table describes the parameters that can be used in a request.

  • Required parameters must be used or the call will fail.
  • Parameters and values are case-sensitive.
  • Optional parameters may be used.
Required parametersDescription

baseURL
string

The base URL for calling TomTom services.
Value: api.tomtom.com

versionNumber
string

The version of the service to call.
Value: The current value is 1.

key
string

The authorization key for access to the API.
Value: Your valid API Key.

points
float,float

Semicolon separated list of points.

  • Each must have a longitude and a latitude field separated by a comma.

  • Longitude and latitude must be calculated using EPSG:4326 projection (also known as WGS84 ).

  • The maximum allowed number of points in a request is 5000 while the minimum is 2.

  • The maximum road distance between two consecutive points cannot exceed 6000 meters.

Value: longitude,latitude;...

Optional parametersDescription

headings
string

A semicolon-separated list indicating the direction of movement.

  • If provided, the heading will be taken into account by the map matching algorithm. The number of headings must be the same as the number of points.

  • It is possible to skip the heading value for a given point by leaving it blank (see example ).

  • The heading value is represented in degrees, 0 is North, 90 is East, etc.

Default value: none Allowed values: 0..360

timestamps
string

A semicolon-separated list indicating the timestamps of obtained points.

  • If provided, the timestamp will be taken into account by the matching algorithm to determine end time of selected restrictions. The number of timestamps must be the same as the number of points.

  • It is possible to skip the timestamp value for a given point by leaving it blank (see example ).

  • The timestamp value must be compliant with ISO 8601 date and time format.

fields
string

The fields to be included in the response, nested as in the response schema.

  • In order to obtain all of the data, it is necessary to place the whole object in the query (see below).

  • An empty object (empty { } ) in a fields string is treated as a malformed request.

Default value: {route{{geometry{coordinates}}}


Value needed to obtain all data - JSON
1{
2 projectedPoints{
3 type,
4 geometry{
5 type,
6 coordinates
7 },
8 properties{
9 routeIndex,
10 snapResult
11 }
12 },
13 route{
14 type,
15 geometry{
16 type,
17 coordinates
18 },
19 properties{
20 id,
21 linearReference,
22 speedLimits{
23 value,
24 unit,
25 type
26 },
27 speedProfile{
28 value,
29 unit
30 },
31 address{
32 roadName,
33 roadNumbers,
34 municipality,
35 countryName,
36 countryCode,
37 countrySubdivision
38 },
39 maximumDimensions{
40 height{
41 value,
42 unit
43 },
44 length{
45 value,
46 unit
47 },
48 width{
49 value,
50 unit
51 },
52 totalWeight{
53 value,
54 unit
55 },
56 weightPerAxle{
57 value,
58 unit
59 }
60 },
61 traveledDistance{
62 value,
63 unit
64 },
65 privateRoad,
66 partOfTunnel,
67 urbanArea,
68 elementType,
69 frc,
70 formOfWay,
71 roadUse,
72 laneInfo{
73 numberOfLanes
74 },
75 heightInfo{
76 height,
77 chainage,
78 unit
79 },
80 trafficSigns{
81 signType,
82 chainage,
83 unit
84 },
85 trafficLight,
86 confidence,
87 emissionRegulations {
88 restrictionType,
89 emissionClass,
90 engineType
91 }
92 }
93 },
94 distances{
95 total,
96 ferry,
97 road,
98 privateRoad,
99 publicRoad,
100 offRoad,
101 unit
102 }
103}

vehicleType
string

It can contribute to a more accurate road identification by possibly excluding roads that are not suited for a given value. If the Emergency value is given, no roads are excluded.
Default value: PassengerCar
Allowed values:

  • PassengerCar

  • Bus

  • Truck

  • Emergency

  • Taxi

measurementSystem
string

Indicates the measurement system in which the client requests data. If auto is set, the measurement system is detected based on the location of the first matched road. For example, if the first matched road element is located in the USA, then values are given in the imperial measurement system where applicable.
Default value: auto
Allowed values:

  • auto

  • metric

  • imperial

offroadMargin
float

It can contribute to detect an offroad movement of the vehicle. Any input point being further (from any road segment) than this value is considered as an offroad point.
Default value: 50 (metric) or 164 (imperial)
Allowed values:

  • metric: from 20 to 100

  • imperial: from 66 to 328

HTTPS method: POST

For ease of viewing and identification:

  • Constants and parameters enclosed in curly brackets must be replaced with their values.
  • Please see the following POST request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
post
URL request format
https://{baseURL}/snapToRoads/{versionNumber}?key={Your_API_Key}&fields={string}&vehicleType={string}&measuremenSystem={string}
post
URL request example (only speed limits)
https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&fields={route{properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto
post
curl command request example (only speed limits)
1curl -X POST 'https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&fields={route{properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto' -d '{
2"points": [
3 {
4 "type": "Feature",
5 "geometry": {
6 "type": "Point",
7 "coordinates": [4.6104919036936565,52.37576529649988]
8 },
9 "properties": {
10 "heading": 0
11 }
12 },
13 {
14 "type": "Feature",
15 "geometry": {
16 "type": "Point",
17 "coordinates": [4.614096792595859,52.38341473290629]
18 },
19 "properties": {
20 "heading": 0
21 }
22 }
23 ]
24}'
post
URL request example (projected points and road elements with geometry, speed limits, and IDs)
https://api.tomtom.com/snapToRoads/1?key={Your_API_Key}&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto
post
curl command request example (projected points and road elements with geometry, speed limits, and IDs)
1curl -X POST 'https://api.tomtom.com/snapToRoads/1?key=Your_API_Key&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,speedLimits{value,unit,type}}}}&vehicleType=PassengerCar&measurementSystem=auto' -d '{
2"points": [
3 {
4 "type": "Feature",
5 "geometry": {
6 "type": "Point",
7 "coordinates": [4.6104919036936565,52.37576529649988]
8 },
9 "properties": {
10 "heading": 0
11 }
12 },
13 {
14 "type": "Feature",
15 "geometry": {
16 "type": "Point",
17 "coordinates": [4.614096792595859,52.38341473290629]
18 },
19 "properties": {
20 "heading": 0
21 }
22 }
23 ]
24}'
post
URL request example (all possible data)
https://api.tomtom.com/snapToRoads/1?key=Your_API_Key&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,linearReference,speedLimits{value,unit,type},speedProfile{value,unit},address{roadName,roadNumbers,municipality,countryName,countryCode,countrySubdivision},maximumDimensions{height{value,unit},length{value,unit},width{value,unit},totalWeight{value,unit},weightPerAxle{value,unit}},elementType,traveledDistance{value,unit},privateRoad,partOfTunnel,urbanArea,frc,formOfWay,roadUse,laneInfo{numberOfLanes},heightInfo{height,chainage,unit},trafficSigns{signType,chainage,unit},trafficLight,confidence,emissionRegulations{restrictionType,emissionClass,engineType}}},distances{total,ferry,publicRoad,privateRoad,road,offRoad,unit}}&vehicleType=PassengerCar&measurementSystem=auto&offroadMargin=50
post
curl command request example (all possible data)
1curl -X POST 'https://api.tomtom.com/snapToRoads/1?key=Your_API_Key&fields={projectedPoints{type,geometry{type,coordinates},properties{routeIndex,snapResult}},route{type,geometry{type,coordinates},properties{id,linearReference,speedLimits{value,unit,type},speedProfile{value,unit},address{roadName,roadNumbers,municipality,countryName,countryCode,countrySubdivision},maximumDimensions{height{value,unit},length{value,unit},width{value,unit},totalWeight{value,unit},weightPerAxle{value,unit}},elementType,traveledDistance{value,unit},privateRoad,partOfTunnel,urbanArea,frc,formOfWay,roadUse,laneInfo{numberOfLanes},heightInfo{height,chainage,unit},trafficSigns{signType,chainage,unit},trafficLight,confidence,emissionRegulations{restrictionType,emissionClass,engineType}}},distances{total,ferry,publicRoad,privateRoad,road,offRoad,unit}}&vehicleType=PassengerCar&measurementSystem=auto&offroadMargin=50' -d '
2{
3"points": [
4 {
5 "type": "Feature",
6 "geometry": {
7 "type": "Point",
8 "coordinates": [4.6104919036936565,52.37576529649988]
9 },
10 "properties": {
11 "heading": 0
12 }
13 },
14 {
15 "type": "Feature",
16 "geometry": {
17 "type": "Point",
18 "coordinates": [4.614096792595859,52.38341473290629]
19 },
20 "properties": {
21 "heading": 0
22 }
23 }
24 ]
25}'

POST request parameters

The following table describes the parameters that can be used in a request.

  • Required parameters must be used or the call will fail.
  • Parameters and values are case-sensitive.
  • Optional parameters may be used.
Required parametersDescription

baseURL
string

The base URL for calling TomTom services.
Value: api.tomtom.com

versionNumber
string

The version of the service to call.
Value: The current value is 1.

key
string

The authorization key for access to the API.
Value: Your valid API Key.

Optional parametersDescription

fields
string

The fields to be included in the response, nested as in the response schema.

  • In order to obtain all data, it is necessary to place the whole object in the query (see below).

  • An empty object (empty { } ) in a fields string is treated as a malformed request.

Default value: {route{geometry{coordinates}}}

Value needed to obtain all data - JSON
1{
2 projectedPoints{
3 type,
4 geometry{
5 type,
6 coordinates
7 },
8 properties{
9 routeIndex,
10 snapResult
11 }
12 },
13 route{
14 type,
15 geometry{
16 type,
17 coordinates
18 },
19 properties{
20 id,
21 linearReference,
22 speedLimits{
23 value,
24 unit,
25 type
26 },
27 speedProfile{
28 value,
29 unit
30 },
31 address{
32 roadName,
33 roadNumbers,
34 municipality,
35 countryName,
36 countryCode,
37 countrySubdivision
38 },
39 maximumDimensions{
40 height{
41 value,
42 unit
43 },
44 length{
45 value,
46 unit
47 },
48 width{
49 value,
50 unit
51 },
52 totalWeight{
53 value,
54 unit
55 },
56 weightPerAxle{
57 value,
58 unit
59 }
60 },
61 traveledDistance{
62 value,
63 unit
64 },
65 privateRoad,
66 partOfTunnel,
67 urbanArea,
68 elementType,
69 frc,
70 formOfWay,
71 roadUse,
72 laneInfo{
73 numberOfLanes
74 },
75 heightInfo{
76 height,
77 chainage,
78 unit
79 },
80 trafficSigns{
81 signType,
82 chainage,
83 unit
84 },
85 trafficLight,
86 confidence,
87 emissionRegulations {
88 restrictionType,
89 emissionClass,
90 engineType
91 }
92 }
93 },
94 distances{
95 total,
96 ferry,
97 road,
98 privateRoad,
99 publicRoad,
100 offRoad,
101 unit
102 }
103}

vehicleType
string

It can contribute to a more accurate road identification by possibly excluding roads that are not suited for the given value. If the Emergency value is given, no roads are excluded.
Default value: PassengerCar
Allowed values:

  • PassengerCar

  • Bus

  • Truck

  • Emergency

  • Taxi

measurementSystem
string

Indicates the measurement system in which a client requests data.
Default value: metric
Allowed values:

  • metric

  • imperial

Request body

Follow the request body schema in order to prepare a valid POST request. The maximum size of the HTTP POST request body is 10 MB.

Request schema

An exclamation mark ! means that this field is required.

post
POST body request schema - JSON
1{
2 type Query {
3 points: [Point!]!
4 }
5 type Point {
6 type: GeojsonFeatureType!
7 geometry: GeojsonPoint!
8 properties: Properties
9 }
10 type GeojsonPoint {
11 type: GeojsonPointType!
12 coordinates: [Float!]!
13 }
14 type Properties {
15 heading: Float
16 timestamp: String
17 }
18 enum GeojsonPointType {
19 Point
20 }
21 enum GeojsonFeatureType {
22 Feature
23 }
24}

Fields of the request body

Structure of the root object
FieldDescription

points
object

The list of points.

  • Each of them must have a geometry field and may have a properties field.

  • It should contain at least 2 points and at most 5000 points.

Structure of the point object
FieldDescription

type
string

The value is always set as Feature.

geometry
object

This is a GeoJSON object type which must contain the type and coordinates fields.

properties
object

It may contain data in order to increase the likelihood of correctly snapping the point.

Structure of the geometry object
FieldDescription

type
string

The value is always set as a Point.

coordinates
array of float

It must contain exactly two numbers which represent the longitude and latitude of the point.

Structure of the properties object
FieldDescription

heading
float

The directional heading of the vehicle in degrees for travel along a segment of roadway.

  • It is represented in degrees, 0 is North, 90 is East, and so on.

  • Values range -360..360.

timestamp
string

The timestamp of obtained point.

  • If provided, the timestamp will be taken into account by the matching algorithm to determine end time of selected restrictions.

  • The timestamp value must be compliant with ISO 8601 date and time format.

post
POST request body example - JSON
1{
2 "points": [
3 {
4 "type": "Feature",
5 "geometry": {
6 "type": "Point",
7 "coordinates": [4.6104919036936565, 52.37576529649988]
8 },
9 "properties": {
10 "heading": 0,
11 "timestamp": "2021-01-01T12:00:00Z"
12 }
13 },
14 {
15 "type": "Feature",
16 "geometry": {
17 "type": "Point",
18 "coordinates": [4.614096792595859, 52.38341473290629]
19 },
20 "properties": {
21 "heading": 0,
22 "timestamp": "2021-01-01T12:01:00Z"
23 }
24 }
25 ]
26}

HTTP request headers

The following table lists HTTP request headers of particular interest to clients of the Synchronous Snap to Roads endpoint.

Note: There are no required headers in this endpoint.

Optional headersDescription

Accept-Encoding

Contains the content encoding (usually a compression algorithm), that the client is able to understand.
Value: gzip

Tracking-ID

Specifies an identifier for the request.

  • It can be used to trace a call.
  • The value must match the regular expression '^[a-zA-Z0-9-]{1,100}$'.

  • An example of the format that matches this regular expression is a UUID (e.g., 9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1 ). For details check RFC 4122.

  • If specified, it is replicated in the Tracking-ID response header.

  • It is only meant to be used for support and does not involve tracking of you or your users in any form.

Value: <string>

Response data

Successful response

For a single valid request, the Synchronous Snap to Roads endpoint returns its response body in JSON format. The fields that appear in the JSON response depend on the value of the fields request parameter. By default, the client only gets the geometry of projected points.

Response schema

Exclamation mark ! means that the field is not nullable. For example:

  • Point! - is non-nullable
  • [Point!] - list of non-null objects
  • [Point]! - list cannot be null, but it can contain null values
post
Response schema
1{
2 union AnyElement = RoadElement | FerryElement
3 type Query {
4 projectedPoints: [ProjectedPoint!]!
5 route: [AnyElement!]!
6 distances: Distances!
7 }
8
9 type Distances {
10 total: Int!
11 ferry: Int!
12 road: Int!
13 privateRoad: Int!
14 publicRoad: Int!
15 offRoad: Int!
16 unit: DistanceUnit!
17 }
18
19 type ProjectedPoint {
20 type: GeojsonFeatureType!
21 geometry: GeojsonPoint
22 properties: ProjectedPointProperties!
23 }
24
25 type ProjectedPointProperties {
26 routeIndex: Int
27 snapResult: String!
28 }
29
30 type FerryElement {
31 type: GeojsonFeatureType!
32 geometry: GeojsonLinestring!
33 properties: FerryElementProperties!
34 }
35
36 type RoadElement {
37 type: GeojsonFeatureType!
38 geometry: GeojsonLinestring!
39 properties: RoadElementProperties!
40 }
41
42 type RoadElementProperties {
43 id: String!
44 linearReference: String!
45 address: RoadAddress!
46 maximumDimensions:MaximumDimension
47 speedLimits: SpeedLimit
48 speedProfile: SpeedProfile
49 elementType: ElementType!
50 frc: Int!
51 formOfWay: String
52 roadUse: String
53 laneInfo: LaneInfo!
54 traveledDistance: Distance!
55 privateRoad: bool!
56 partOfTunnel: bool!
57 urbanArea: bool!
58 heightInfo: [HeightInfo!]!
59 trafficSigns: [TrafficSign!]!
60 trafficLight: String
61 confidence: Float!
62 emissionRegulations: [EmissionRegulation!]
63 }
64
65 type FerryElementProperties {
66 id: String!
67 linearReference: String!
68 address: FerryAddress!
69 maximumDimensions:MaximumDimension
70 elementType: ElementType!
71 frc: Int!
72 traveledDistance: Distance!
73 privateRoad: bool!
74 partOfTunnel: bool!
75 urbanArea: bool!
76 confidence: Float!
77 }
78
79 type LaneInfo {
80 numberOfLanes: Int
81 }
82
83 type Distance {
84 value: Int!
85 unit: DistanceUnit!
86 }
87
88 type SpeedLimit {
89 value: Int!
90 unit: SpeedUnit!
91 type: String!
92 }
93
94 type SpeedProfile {
95 value: Int!
96 unit: SpeedUnit!
97 }
98
99 type FerryAddress {
100 roadName: String
101 roadNumbers: [String!]!
102 }
103
104 type RoadAddress {
105 roadName: String
106 roadNumbers: [String!]!
107 municipality: String
108 countryName: String
109 countryCode: String
110 countrySubdivision: String
111 }
112
113 type MaximumDimension {
114 height : Dimension
115 length : Dimension
116 width : Dimension
117 totalWeight : Dimension
118 weightPerAxle : Dimension
119 }
120
121 type Dimension {
122 value : Int!
123 unit : String!
124 }
125
126 type HeightInfo {
127 height: Int!
128 chainage: Int!
129 unit: DistanceUnit!
130 }
131
132 type TrafficSign {
133 signType: String!
134 chainage: Int!
135 unit: DistanceUnit!
136 }
137
138 type EmissionRegulation {
139 restrictionType: String!
140 emissionClass : [Int!]!
141 engineType: [EngineType!]!
142 }
143
144 enum EngineType {
145 LPG,
146 CNG,
147 LNG,
148 Diesel,
149 Petrol,
150 Hydrogen,
151 Electric,
152 Hybrid,
153 Plugin Hybrid
154 }
155
156 enum DistanceUnit {
157 cm,
158 m,
159 ft
160 }
161
162 enum SpeedUnit {
163 kmph,
164 mph
165 }
166
167 enum ElementType {
168 Road,
169 Ferry
170 }
171
172 type GeojsonPoint {
173 type: GeojsonPointType!
174 coordinates: [Float!]!
175 }
176
177 type GeojsonLinestring {
178 type: GeojsonLinestringType!
179 coordinates: [[Float!]!]!
180 }
181
182 enum GeojsonLinestringType {
183 LineString
184 }
185
186 enum GeojsonPointType {
187 Point
188 }
189
190 enum GeojsonFeatureType {
191 Feature
192 }
193}

Response field structure

The following tables describe JSON element fields that can appear in a response.

Structure of the root object
FieldDescription

projectedPoints
array of ProjectedPoint

  • The list of the points projected on the road network which relates to the points from a request.

  • Each object in this array corresponds to a particular point in the query.

  • The order of objects in this array is the same as the order of the points from the query.

route
array of AnyElement

The list of road/ferry elements forming the reconstructed route.

distances
Distances

The traveled distance within the road segment or on the ferry in meters or feet depending on the chosen measurement system.

Structure of the ProjectedPoint object
FieldDescription

type
string

The value is set as Feature ( GeoJSON feature object).

geometry
object

A GeoJSON feature of type Point.

  • It always contains the type and coordinates fields.

  • It is a projection of a request point on a particular matched road element.

  • If the value is equal to null, it means that it is not possible to project a point because it is not able to be matched to any road element.

properties
object

They contain information about a point.
Structure of the ProjectedPointProperties object
FieldDescription

routeIndex
integer

The index of a matching road element from the route array. It can be equal to null if a point is not able to be matched (see snapResult ) to any road element.

snapResult
string

Stores the result given by the matching algorithm.
Allowed values:

  • Matched
  • OffRoad
  • MaxDistanceExceeded
Structure of the FerryElement object
FieldDescription

type
string

The value is set as Feature ( GeoJSON feature object).

geometry
object

A GeoJSON feature of type LineString. It always contains the type and coordinates fields.

properties
FerryElementProperties

Detailed information about the ferry element.
Structure of the RoadElement object
FieldDescription

type
string

The value is set as Feature ( GeoJSON feature object).

geometry
object

A GeoJSON feature of type LineString. It always contains the type and coordinates fields.

properties
RoadElementProperties

Detailed information about the road element.
Structure of the FerryElementProperties object
FieldDescription

id
string

Unique ID of the ferry element.

linearReference
string

Base64 encoded location reference expressed in OpenLR format.
OpenLR is a method for map agnostic location.
It enables systems to communicate location information when they use dissimilar maps.

address
RoadAddress

Address information relevant to the ferry element.

maximumDimensions
MaximumDimension

Information about the maximum dimensions of a vehicle allowed to use this road.

elementType
ElementType

Type of the element.
Allowed values: Ferry

frc
integer

FRC (Functional Road Class) represents a classification of roads based on the importance that the constituting roads have in the road network.
Allowed values (if applicable): 0..8

traveledDistance
Distance

The traveled distance within the ferry segment in meters or feet depending on the chosen measurement system.

privateRoad
boolean

Ferry element ownership.
Allowed values:

  • true

  • false

partOfTunnel
boolean

Ferry element that is a part of a tunnel.
Allowed values:

  • true

  • false

urbanArea
boolean

Ferry element that is a part of an urban area.
Allowed values:

  • true

  • false

confidence
float

It represents the algorithm's confidence for the given ferry element. It's a float from the range (0,1].

Structure of the RoadElementProperties object
FieldDescription

id
string

Unique ID of the road element.

linearReference
string

Base64 encoded location reference expressed in OpenLR format.
OpenLR is a method for map agnostic location.
It enables systems to communicate location information when they use dissimilar maps.

speedLimits
SpeedLimit

Speed limits for a given vehicleType.

  • If NO timestamps are provided, then only speed limits matching the UTC request time are taken into account by the matching algorithm.
  • If ANY timestamps are provided, then only speed limits matching the provided timeframe are taken into account by the matching algorithm.

speedProfile
SpeedProfile

Speed profile represented as average speed in a given road segment in a given timeframe. The time frame is calculated from a GPS point timestamp if was provided, otherwise UTC request time is taken into account .

address
RoadAddress

Address information relevant to the road element.

maximumDimensions
MaximumDimension

Information about the maximum dimensions of a vehicle allowed to use this road.

elementType
ElementType

Type of the element.
Allowed value: Road

frc
integer

FRC (Functional Road Class) represents a classification of roads based on the importance that the constituting roads have in the total road network.
Allowed values (if applicable): 0..8

formOfWay
string

Form of way represents the physical form of a road. This is based on a number of certain physical characteristics and traffic properties.
Allowed values (if applicable):

  • DualCarriageway
  • SingleCarriageway
  • Roundabout
  • MajorSlipRoad
  • ParallelRoad
  • RoadForAuthorities
  • EntranceToOrExitFromACarPark
  • SmallSlipRoad
  • RoadInEnclosedTrafficArea
  • RoadInPedestrianZone
  • ServiceRoad
  • ETAParkingArea
  • SpecialTrafficFigure
  • SmallMajorSlipRoad
  • ETAParkingBuilding
  • Walkway
  • Stairs
  • CulDeSac
  • ETAGallery
  • Connector
  • Unknown

roadUse
string

It specifies how the road element is used for travel.
Allowed values:

  • LimitedAccess
  • Arterial
  • Terminal
  • Ramp
  • Rotary
  • LocalStreet

laneInfo
LaneInfo

Lane Information refers to the collection of lane-related information stored in a Road Element.

traveledDistance
Distance

The traveled distance within the road segment in meters or feet depending on the chosen measurement system.

privateRoad
boolean

Road element ownership.
Allowed values:

  • true

  • false

partOfTunnel
boolean

Road element is a part of a tunnel.
Allowed values:

  • true

  • false

urbanArea
boolean

Road element is a part of an urban area.
Allowed values:

  • true

  • false

heightInfo
array of HeightInfo

Information about the road element's height.

trafficSigns
array of TrafficSign

Information about traffic signs along the traveled road.

trafficLight
string

Position of a traffic light on the route segment.
Allowed values:

  • Start

  • End

  • Both

confidence
float

It represents the algorithm's confidence for the given road element. It's a float from the range (0,1].

emissionRegulations
array of EmissionRegulation

It provides information about the restriction (Ban or Fee) for a vehicle with a particular type of pollution emission according to a standard emission scheme.

Structure of the FerryAddress object
FieldDescription

roadName
string

Road name in NGT format.

roadNumbers
array of strings

The list of road numbers.
Structure of the RoadAddress object
FieldDescription

roadName
string

Road name in NGT format.

roadNumbers
array of strings

The list of road numbers.

municipality
string

City name in NGT format.

countryName
string

Country name in NGT format.

countryCode
string

ISO 3166-1 alpha-3 country code.

countrySubdivision
string

State or province name in NGT format.

Structure of the MaximumDimension object
FieldDescription

height
Dimension

Maximum height of a vehicle.

length
Dimension

Maximum length of a vehicle.

width
Dimension

Maximum width of a vehicle.

totalWeight
Dimension

Maximum weight of a vehicle.

weightPerAxle
Dimension

Maximum weight per axle.
Structure of the Dimension object
FieldDescription

value
integer

Value of dimension.

unit
String

Unit of dimension value.


Structure of the LaneInfo object
FieldDescription

numberOfLanes
integer

Number of lanes the road segment has.
Allowed values (if applicable): null, above or equal to 1.

Structure of the SpeedLimit object
FieldDescription

value
int

Value of the speed limit.

unit
string

Unit of the speed limit.

type
string

Type of the speed limit.
Allowed values:

  • Maximum
  • Recommended
Structure of the Distance object
FieldDescription

value
int

Value of the driven distance.

unit
string

Unit of the distance.
Structure of the Distances object
FieldDescription

total
int

Total traveled distance in meters or feet depending on the chosen measurement system.

ferry
int

The traveled distance on a ferry in meters or feet depending on the chosen measurement system.

road
int

Traveled distance within the road segment in meters or feet depending on the chosen measurement system.

privateRoad
int

Traveled distance within the private road segment in meters or feet depending on the chosen measurement system.

publicRoad
int

Traveled distance within the public road segment in meters or feet depending on the chosen measurement system.

offRoad
int

Traveled distance out of the road segment in meters or feet depending on the chosen measurement system.

unit
string

Unit of distances.
Structure of the HeightInfo object
FieldDescription

height
int

Represents the height of a road above a reference geoid EGM2008 at a specified location. Expressed in cm or feet depending on the measurement system.

chainage
int

Represents the distance along a Road Element measured from a fixed reference point. Expressed in cm or feet depending on the measurement system.

unit
string

Unit of the chainage.
Structure of the TrafficSign object
FieldDescription

signType
string

Information about the type of the traffic sign. Currently, the service returns information about:

  • AccidentHazardSign
  • AvalancheAreaSign
  • BuiltUpAreaEntrySign
  • BuiltUpAreaExitSign
  • CenterLaneEndsSign
  • ChildrenSign
  • CongestionHazardSign
  • CrossWindSign
  • CyclistsSign
  • DangerousCurveSign
  • DomesticAnimalCrossingSign
  • EndOfAllRestrictionsSign
  • EndOfOvertakingRestrictionSign
  • EndOfPriorityRoadSign
  • EndOfSpeedRestrictionSign
  • FallingRocksSign
  • FogAreaSign
  • GeneralWarningSign
  • GuardedRailwayCrossingSign
  • IcyConditionsSign
  • IntersectionWithPriorityToTheRightSign
  • LeftLaneEndsSign
  • MovableBridgeSign
  • NarrowingRoadAtLeftSign
  • NarrowingRoadAtRightSign
  • NarrowingRoadSign
  • OvertakingLaneSign
  • OvertakingRestrictionSign
  • PedestrianCrossingSign
  • PriorityOverOncomingVehiclesSign
  • PriorityRoadSign
  • RightLaneEndsSign
  • RoundaboutAheadSign
  • SharpCurveLeftSign
  • SharpCurveRightSign
  • SlipperyRoadSign
  • SpeedSign
  • SteepDeclineSign
  • SteepInclineSign
  • SteepSlopeSign
  • StopSign
  • TrafficLightAheadSign
  • UnguardedRailwayCrossingSign
  • VariableTrafficSign
  • WildlifeCrossingSign
  • WindingRoadStartingLeftSign
  • WindingRoadStartingRightSign
  • YieldSign
  • YieldToOncomingVehiclesSign

chainage
int

Represents the distance between the starting point of travel on the route segment and the traffic sign. Expressed in cm or feet depending on the measurement system.

unit
string

Unit of the chainage.
Structure of the EmissionRegulation object
FieldDescription

restrictionType
string

The type of the restriction. Currently, the service returns information about:

  • Ban - vehicle is forbidden to enter the road.
  • Fee - vehicle is allowed to enter the road after paying the fee.

emissionClass
array of integer

The emission class represents the type of emission according to a standard emission scheme.

engineType
array of EngineType

The type of engine the restriction applies to. Currently, the service returns information about engine types:

  • LPG
  • CNG
  • LNG
  • Diesel
  • Petrol
  • Hydrogen
  • Electric
  • Hybrid
  • Plugin Hybrid

Successful response examples

Example response (only speed limits) - JSON
1{
2 "route": [
3 {
4 "properties": {
5 "id": "88a7637c-db86-448c-aca9-b7d1f1b66ea0",
6 "speedLimits": {
7 "value": 70,
8 "unit": "kmph",
9 "type": "Maximum"
10 }
11 }
12 },
13 ...
14 {
15 "properties": {
16 "id": "c23e417c-ac30-4764-9272-9909b7448f87",
17 "speedLimits": {
18 "value": 70,
19 "unit": "kmph",
20 "type": "Maximum"
21 }
22 }
23 },
24 {
25 "properties": {
26 "id": "cd03f919-c6c5-48ca-8c0f-130db62d77b7",
27 "speedLimits": {
28 "value": 70,
29 "unit": "kmph",
30 "type": "Maximum"
31 }
32 }
33 },
34 {
35 "properties": {
36 "id": "bc4a05a8-5340-49e4-82fb-a8abba07a8a6",
37 "speedLimits": {
38 "value": 70,
39 "unit": "kmph",
40 "type": "Maximum"
41 }
42 }
43 }
44 ]
45}
Example response (projected points and road elements with geometry, speed limits, and IDs) - JSON
1{
2 "route": [
3 {
4 "type": "Feature",
5 "geometry": {
6 "type": "LineString",
7 "coordinates": [[4.6109198034,52.3757167161],[4.6109291911,52.3757502437],[4.6110069752,52.3759138584],[4.6110418439,52.3759916425],[4.6110659838,52.3760412633]]
8 },
9 "properties": {
10 "id": "88a7637c-db86-448c-aca9-b7d1f1b66ea0",
11 "speedLimits": {
12 "value": 70,
13 "unit": "kmph",
14 "type": "Maximum"
15 }
16 }
17 },
18 ...
19 {
20 "type": "Feature",
21 "geometry": {
22 "type": "LineString",
23 "coordinates": [[4.6134424210,52.3791351914],[4.6134652197,52.3791633546],[4.6137334406,52.3795053363],[4.6138648689,52.3796957731],[4.6139051020,52.3797588050]]
24 },
25 "properties": {
26 "id": "c23e417c-ac30-4764-9272-9909b7448f87",
27 "speedLimits": {
28 "value": 70,
29 "unit": "kmph",
30 "type": "Maximum"
31 }
32 }
33 },
34 {
35 "type": "Feature",
36 "geometry": {
37 "type": "LineString",
38 "coordinates": [[4.6139051020,52.3797588050],[4.6140727401,52.3800149560],[4.6141116321,52.3800887167]]
39 },
40 "properties": {
41 "id":"cd03f919-c6c5-48ca-8c0f-130db62d77b7",
42 "speedLimits": {
43 "value": 70,
44 "unit": "kmph",
45 "type": "Maximum"
46 }
47 }
48 },
49 {
50 "type": "Feature",
51 "geometry": {
52 "type": "LineString",
53 "coordinates": [[4.6141116321,52.3800887167],[4.6141947806,52.3802402616]]
54 },
55 "properties": {
56 "id":"bc4a05a8-5340-49e4-82fb-a8abba07a8a6",
57 "speedLimits": {
58 "value": 70,
59 "unit": "kmph",
60 "type": "Maximum"
61 }
62 }
63 }
64 ],
65 "projectedPoints": [
66 {
67 "type": "Feature",
68 "geometry": {
69 "type": "Point",
70 "coordinates": [4.6109191758,52.3757173113]
71 },
72 "properties": {
73 "routeIndex": 0,
74 "snapResult": "Matched"
75 }
76 },
77 {
78 "type": "Feature",
79 "geometry": {
80 "type": "Point",
81 "coordinates": [4.6147588418,52.3834214472]
82 },
83 "properties": {
84 "routeIndex": 10,
85 "snapResult": "Matched"
86 }
87 }
88 ]
89}
Example response (all possible data) - JSON
1{
2 "route": [
3 {
4 "type": "Feature",
5 "geometry": {
6 "type": "LineString",
7 "coordinates": [[4.6109198034,52.3757167161],[4.6109291911,52.3757502437],[4.6110069752,52.3759138584],[4.6110418439,52.3759916425],[4.6110659838,52.3760412633]]
8 },
9 "properties": {
10 "id": "88a7637c-db86-448c-aca9-b7d1f1b66ea0",
11 "speedLimits": {
12 "value": 70,
13 "unit": "kmph",
14 "type": "Maximum"
15 },
16 "speedProfile": {
17 "value": 70,
18 "unit": "kmph"
19 },
20 "address": {
21 "roadName": "Westelijke Randweg",
22 "roadNumbers": ["N208"],
23 "municipality": "Haarlem",
24 "countryName": "Nederland",
25 "countryCode": "NLD",
26 "countrySubdivision": "Noord-Holland"
27 },
28 "maximumDimensions":{
29 "height": {
30 "value":4,
31 "unit":"m"
32 },
33 "length": {
34 "value":10,
35 "unit":"m"
36 },
37 "width": {
38 "value":4,
39 "unit":"m"
40 },
41 "totalWeight": {
42 "value":6,
43 "unit":"t"
44 },
45 "weightPerAxle": {
46 "value":1.5,
47 "unit":"t"
48 }
49 },
50 "traveledDistance": {
51 "value": 123,
52 "unit": "m"
53 },
54 "privateRoad": false,
55 "partOfTunnel": false,
56 "urbanArea": true,
57 "elementType": "Road",
58 "frc": 2,
59 "formOfWay": "DualCarriageway",
60 "roadUse": "Arterial",
61 "laneInfo": {
62 "numberOfLanes": 2
63 },
64 "heightInfo":[
65 {
66 "height":394,
67 "chainage":0,
68 "unit": "cm"
69 },
70 {
71 "height":1575,
72 "chainage":197,
73 "unit": "cm"
74 },
75 {
76 "height":2756,
77 "chainage":315,
78 "unit": "cm"
79 }
80 ],
81 "trafficSigns":[
82 {
83 "signType": "StopSign",
84 "chainage": 329,
85 "unit": "cm"
86 }
87 ],
88 "trafficLight": "Start",
89 "confidence": 0.67,
90 "emissionRegulations": [
91 {
92 "restrictionType": "Ban",
93 "emissionClass": [
94 0,
95 1,
96 2,
97 3,
98 4
99 ],
100 "engineType": ["Diesel"]
101 },
102 {
103 "restrictionType": "Fee",
104 "emissionClass": [
105 5
106 ],
107 "engineType": ["Petrol"]
108 }
109 ]
110 }
111 },
112 ...
113 {
114 "type": "Feature",
115 "geometry": {
116 "type": "LineString",
117 "coordinates": [[4.6134424210,52.3791351914],[4.6134652197,52.3791633546],[4.6137334406,52.3795053363],[4.6138648689,52.3796957731],[4.6139051020,52.3797588050]]
118 },
119 "properties": {
120 "id": "c23e417c-ac30-4764-9272-9909b7448f87",
121 "speedLimits": {
122 "value": 70,
123 "unit": "kmph",
124 "type": "Maximum"
125 },
126 "speedProfile": {
127 "value": 70,
128 "unit": "kmph"
129 },
130 "address": {
131 "roadName": "Westelijke Randweg",
132 "roadNumbers": ["N208"],
133 "municipality": "Haarlem",
134 "countryName": "Nederland",
135 "countryCode": "NLD",
136 "countrySubdivision": "Noord-Holland"
137 },
138 "maximumDimensions":{
139 "height": {
140 "value":4,
141 "unit":"m",
142 },
143 "length": {
144 "value":10,
145 "unit":"m",
146 },
147 "width": {
148 "value":4,
149 "unit":"m",
150 },
151 "totalWeight": {
152 "value":6,
153 "unit":"t"
154 },
155 "weightPerAxle": {
156 "value":1.5,
157 "unit":"t",
158 }
159 },
160 "traveledDistance": {
161 "value": 321,
162 "unit": "m"
163 },
164 "privateRoad": false,
165 "partOfTunnel": false,
166 "urbanArea": false,
167 "elementType": "Road",
168 "frc": 2,
169 "formOfWay": "DualCarriageway",
170 "roadUse": "Arterial",
171 "laneInfo": {
172 "numberOfLanes": 4
173 },
174 "heightInfo":[
175 {
176 "height": 252,
177 "chainage": 0,
178 "unit": "cm"
179 },
180 {
181 "height": 678,
182 "chainage": 211,
183 "unit": "cm"
184 }
185 ],
186 "trafficSigns":[
187 {
188 "signType": "StopSign",
189 "chainage": 678,
190 "unit": "cm"
191 }
192 ],
193 "trafficLight": "Both",
194 "confidence": 0.87,
195 "emissionRegulations": [
196 {
197 "restrictionType": "Ban",
198 "emissionClass": [
199 0,
200 1,
201 2,
202 3,
203 4
204 ],
205 "engineType": ["Diesel"]
206 },
207 {
208 "restrictionType": "Fee",
209 "emissionClass": [
210 5
211 ],
212 "engineType": ["Petrol"]
213 }
214 ]
215 }
216 },
217 {
218 "type": "Feature",
219 "geometry": {
220 "type": "LineString",
221 "coordinates": [[4.6139051020,52.3797588050],[4.6140727401,52.3800149560],[4.6141116321,52.3800887167]]
222 },
223 "properties": {
224 "id": "cd03f919-c6c5-48ca-8c0f-130db62d77b7",
225 "speedLimits": {
226 "value": 70,
227 "unit": "kmph",
228 "type": "Maximum"
229 },
230 "speedProfile": {
231 "value" : 70,
232 "unit": "kmph"
233 },
234 "address": {
235 "roadName": "Westelijke Randweg",
236 "roadNumbers": ["N208"],
237 "municipality": "Haarlem",
238 "countryName": "Nederland",
239 "countryCode": "NLD",
240 "countrySubdivision": "Noord-Holland"
241 },
242 "maximumDimensions": {
243 "height:" {
244 "value":4,
245 "unit":"m"
246 },
247 "length": {
248 "value":10,
249 "unit":"m"
250 },
251 "width": {
252 "value":4,
253 "unit":"m"
254 },
255 "totalWeight": null,
256 "weightPerAxle":null
257 },
258 "traveledDistance": {
259 "value": 456,
260 "unit": "m"
261 },
262 "privateRoad": false,
263 "partOfTunnel": false,
264 "urbanArea": false,
265 "elementType": "Road",
266 "frc": 2,
267 "formOfWay": "DualCarriageway",
268 "roadUse": "Arterial",
269 "laneInfo": {
270 "numberOfLanes": 3
271 },
272 "heightInfo":[
273 {
274 "height": 354,
275 "chainage": 0,
276 "unit": "cm"
277 },
278 {
279 "height": 125,
280 "chainage": 137,
281 "unit": "cm"
282 },
283 {
284 "height": 756,
285 "chainage": 244,
286 "unit": "cm"
287 }
288 ],
289 "trafficLight": "End",
290 "confidence": 0.92,
291 "emissionRegulations": [
292 {
293 "restrictionType": "Ban",
294 "emissionClass": [
295 0,
296 1,
297 2,
298 3,
299 4
300 ],
301 "engineType": ["Diesel"]
302 },
303 {
304 "restrictionType": "Fee",
305 "emissionClass": [
306 5
307 ],
308 "engineType": ["Petrol"]
309 }
310 ]
311 }
312 },
313 {
314 "type": "Feature",
315 "geometry": {
316 "type": "LineString",
317 "coordinates": [[4.6141116321,52.3800887167],[4.6141947806,52.3802402616]]
318 },
319 "properties": {
320 "id": "bc4a05a8-5340-49e4-82fb-a8abba07a8a6",
321 "speedLimits": {
322 "value": 70,
323 "unit": "kmph",
324 "type": "Maximum"
325 },
326 "speedProfile": {
327 "value": 70,
328 "unit": "kmph"
329 },
330 "address": {
331 "roadName": "Westelijke Randweg",
332 "roadNumbers": ["N208"],
333 "municipality": "Haarlem",
334 "countryName": "Nederland",
335 "countryCode": "NLD",
336 "countrySubdivision": "Noord-Holland"
337 },
338 "maximumDimensions":{
339 "height": {
340 "value":4,
341 "unit":"m",
342 },
343 "length": {
344 "value":10,
345 "unit":"m",
346 },
347 "width": {
348 "value":4,
349 "unit":"m",
350 },
351 "totalWeight": null,
352 "weightPerAxle": null
353 },
354 "traveledDistance": {
355 "value": 654,
356 "unit": "m"
357 },
358 "privateRoad": false,
359 "partOfTunnel": false,
360 "urbanArea: false,
361 "elementType": "Road",
362 "frc": 2,
363 "formOfWay": "DualCarriageway",
364 "roadUse": "Arterial",
365 "laneInfo": {
366 "numberOfLanes": 3
367 },
368 "heightInfo":[
369 {
370 "height": 1394,
371 "chainage": 0,
372 "unit": "cm"
373 },
374 {
375 "height": 1675,
376 "chainage": 97,
377 "unit": "cm"
378 },
379 {
380 "height": 1756,
381 "chainage": 215,
382 "unit": "cm"
383 }
384 ],
385 "confidence": 0.89,
386 "emissionRegulations": [
387 {
388 "restrictionType": "Ban",
389 "emissionClass": [
390 0,
391 1,
392 2,
393 3,
394 4
395 ],
396 "engineType": ["Diesel"]
397 },
398 {
399 "restrictionType": "Fee",
400 "emissionClass": [
401 5
402 ],
403 "engineType": ["Petrol"]
404 }
405 ]
406 }
407 }
408 ]
409 "projectedPoints": [
410 {
411 "type": "Feature",
412 "geometry": {
413 "type": "Point",
414 "coordinates": [4.6109191758,52.3757173113]
415 },
416 "properties": {
417 "routeIndex": 0,
418 "snapResult": "Matched"
419 }
420 },
421 {
422 "type": "Feature",
423 "geometry": {
424 "type": "Point",
425 "coordinates": [4.6147588418,52.3834214472]
426 },
427 "properties": {
428 "routeIndex": 10,
429 "snapResult": "Matched"
430 }
431 }
432 ],
433 "distances": {
434 "total": 909,
435 "ferry": 0,
436 "publicRoad": 909,
437 "privateRoad": 0,
438 "offRoad": 0,
439 "road": 909,
440 "unit": "m"
441 }
442}

Error response

The Synchronous Snap to Roads endpoint, for an invalid single request, returns a response body in JSON format.

FieldDescription

detailedError
object

Main object of the error response.

code
string

One of a server-defined set of error codes.

message
string

A human-readable description of the error code.
Error response example - JSON
1{
2 "detailedError": {
3 "code": "INVALID_REQUEST",
4 "message": "Missing points parameter."
5 }
6}

HTTP response codes

CodeMeaning & possible causes

200

OK

400

Bad request

403

Forbidden: The supplied API Key is not valid for this request.

405

Method Not Allowed: The provided HTTP request method is known by the server, but is not supported by the target resource.

429

Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key.

500

Internal Server Error

503

Service currently unavailable: The service is currently unavailable.

596

Service Not Found: Unknown version of the service.

HTTP response headers

The following data table lists HTTP response headers of particular interest to clients of the Snap to Roads endpoint.

HeaderDescription

Access-Control-Allow-Origin

Indicates that cross-origin resource sharing (CORS) is allowed.
Value: *

Allow

Lists the set of supported HTTP methods. The header is sent in case a 405 HTTP response code is returned.
Value: GET, HEAD, POST

Content-Encoding

Indicates which encodings were applied to the response body.
Value: gzip

Content-Length

Contains information about the size of the response body.
Value: <decimal number>

Content-Type

Indicates the media type of the resource returned.
Value: <application/json; charset=utf-8>

Date

Contains the date and time at which the message was originated. For details check RFC 7231.
Value: <http-date>

Tracking-ID

An identifier for the request.

  • If the Tracking-ID header was specified in the request, it is replicated in the response.

  • Otherwise, it is generated automatically by the service. For details check RFC 4122.

  • It is only meant to be used for support and does not involve tracking of you or your users in any form.

Value: <string>