Junction manual update

Service version: v1
Last edit: 2025.02.25

Important Note
Explore ready-to-use traffic reports and data visualizations immediately by signing up for a 30-day free trial on the MOVE Portal. Once registered, you'll receive an API key to start using the Traffic Analytics APIs right away. Alternatively, you may contact our Sales team for a tailored solution.

Purpose

The Junction Manual Update is a specialized REST API endpoint designed to provide a customized way to update junctions. Through this endpoint, users can manually define the properties of the junction.

Features

Selective Approaches: This endpoint supports the deactivation of approaches that are not required by the customer.

Workflow

  1. Junction Definition Preview: Before proceeding with the manual update of the junction, utilize the Junction Definition Preview to visualize and review the proposed junction.
  2. Prepare Request: The response from the Junction Definition Preview contains essential fields (junction, approaches, exits) that should be included in the Junction Definition Manual Update request.
  3. Receive Response: Upon successful submission, the response will provide a unique junction ID.

Request data

To manually update the junction, issue a PUT request as demonstrated in the following example. Ensure you adhere to the specified request format for successful updates.

  • Constants and parameters enclosed in curly brackets must be replaced with their values.
  • Please see the following Request parameters section with the required and optional parameter tables for their values. The generic request format is as follows.

HTTPS method: PUT

put
URL request example
https://api.tomtom.com/junction-analytics/junctions/1/{junctionId}/definition/manual?key={Your_API_Key}

PUT request body example

put
PUT request body example - JSON
1{
2 "name": "Otto-Braun-Straße - Karl-Marx-Allee - Alexanderstraße",
3 "detectionConfig": {
4 "autodetectName": true
5 },
6 "junction": {
7 "type": "Feature",
8 "geometry": {
9 "type": "Point",
10 "coordinates": [
11 13.41649420385599,
12 52.52202006909155
13 ]
14 },
15 "properties": {
16 "radius": 51.30814890800801
17 }
18 },
19 "approaches": [
20 {
21 "id": -1194621510,
22 "segmentedGeometry": {
23 "type": "MultiLineString",
24 "coordinates": [
25 [
26 [
27 13.41808,
28 52.52377
29 ],
30 [
31 13.41775,
32 52.52348
33 ]
34 ],
35 [
36 [
37 13.41775,
38 52.52348
39 ],
40 [
41 13.41704,
42 52.52285
43 ]
44 ]
45 ]
46 },
47 "excluded": false
48 },
49 {
50 "id": 1275645260,
51 "segmentedGeometry": {
52 "type": "MultiLineString",
53 "coordinates": [
54 [
55 [
56 13.41958,
57 52.5212
58 ],
59 [
60 13.41889,
61 52.52141
62 ]
63 ],
64 [
65 [
66 13.41889,
67 52.52141
68 ],
69 [
70 13.41871,
71 52.52146
72 ]
73 ]
74 ]
75 },
76 "excluded": false
77 }
78 ],
79 "exits": [
80 {
81 "segmentedGeometry": {
82 "type": "MultiLineString",
83 "coordinates": [
84 [
85 [
86 13.41599,
87 52.52178
88 ],
89 [
90 13.41576,
91 52.52155
92 ]
93 ]
94 ]
95 }
96 },
97 {
98 "segmentedGeometry": {
99 "type": "MultiLineString",
100 "coordinates": [
101 [
102 [
103 13.41641,
104 52.52223
105 ],
106 [
107 13.41625,
108 52.5223
109 ]
110 ]
111 ]
112 }
113 }
114 ]
115}

You can add arrival points to existing junctions. First get the junction definition document from the Junction Definition endpoint:

https://api.tomtom.com/junction-analytics/junctions/1/{junctionId}/definition?key={Your_API_Key}&includeGeometry=true

Modify the junction definition to add arrival points.

PUT the updated document to the Junction Update endpoint: https://api.tomtom.com/junction-analytics/junctions/1/{junctionId}/definition/manual?key={Your_API_Key}.

PUT request body example for enhanced access enabled

put
PUT request body example - JSON
1{
2 "name": "My junction name",
3 "detectionConfig": {
4 "autodetectName": true
5 },
6 "junction": {
7 "type": "Feature",
8 "properties": {
9 "radius": 20
10 },
11 "geometry": {
12 "type": "Point",
13 "coordinates": [
14 13.46555,
15 52.51732
16 ]
17 }
18 },
19 "approaches": [
20 {
21 "id": 277814775,
22 "name": "Samariterstraße South Bound",
23 "roadName": "Samariterstraße",
24 "direction": "SOUTH",
25 "frc": 6,
26 "length": 342.55,
27 "oneWayRoad": false,
28 "excluded": false,
29 "drivable": true,
30 "segmentedGeometry": {
31 "type": "MultiLineString",
32 "coordinates": [
33 [
34 [
35 13.46219,
36 52.51872
37 ],
38 [
39 13.46519,
40 52.51816
41 ],
42 [
43 13.46565,
44 52.51807
45 ],
46 [
47 13.46576,
48 52.51804
49 ],
50 [
51 13.4658,
52 52.51803
53 ],
54 [
55 13.46584,
56 52.518
57 ],
58 [
59 13.46587,
60 52.51797
61 ]
62 ],
63 [
64 [
65 13.46587,
66 52.51797
67 ],
68 [
69 13.46566,
70 52.51755
71 ],
72 [
73 13.46553,
74 52.51731
75 ]
76 ]
77 ]
78 },
79 "openlr": "CwmSrSVYwTLJBgFl/24zQQs=",
80 "dataNotAvailable": false,
81 "arrivalPoints": [
82 {
83 "id": 0,
84 "name": "350_FT",
85 "userPoint": {
86 "type": "Point",
87 "coordinates": [
88 13.465503,
89 52.518099
90 ]
91 }
92 },
93 {
94 "id": 1,
95 "name": "40_FT",
96 "userPoint": {
97 "type": "Point",
98 "coordinates": [
99 13.465586,
100 52.517414
101 ]
102 }
103 },
104 {
105 "id": 2,
106 "name": "0_FT",
107 "userPoint": {
108 "type": "Point",
109 "coordinates": [
110 13.46553,
111 52.51731
112 ]
113 }
114 }
115 ]
116 }
117 ],
118 "exits": [
119 {
120 "id": -1987666488,
121 "name": "Samariterstraße South Bound",
122 "roadName": "Samariterstraße",
123 "direction": "SOUTH",
124 "frc": 7,
125 "oneWayRoad": false,
126 "drivable": true,
127 "segmentedGeometry": {
128 "type": "MultiLineString",
129 "coordinates": [
130 [
131 [
132 13.46553,
133 52.51731
134 ],
135 [
136 13.46544,
137 52.51709
138 ],
139 [
140 13.4651,
141 52.51638
142 ]
143 ]
144 ]
145 },
146 "openlr": "CwmTVCVYfTvxAf/V/6M7AQ=="
147 }
148 ]
149}

Request parameters

The following table shows the query parameters:

  • Required parameters must be used or the call will fail.
  • Optional parameters may be used.
Required parametersDescription

junctionId
string

The unique junction ID that must be used in the request path.

key
string

An API Key valid for the requested service. Value: Your valid API Key.

Put request body fields

name (string) Name for a updated junction. Not required by default. Take a look at detectionConfig.autodetectName. Maximum length is 250 characters.

detectionConfig (object) Contains the detection configuration used in junction update.

  • autodetectName (boolean) If true, the junction name will be updated based on its approaches. If false, the name field is required. Default value: true

junction (object) Required. A GeoJSON Feature, Polygon, or Point (with the radius property). It contains the junction boundary that will be used in the update process.

approaches[] (array) Contains junction approaches. Minimum number of approaches: 1. The details in this section are derived from the Junction Definition Preview.

  • id (integer) The approach ID is unique in the junction context.
  • excluded (boolean) Indicates that live data for the approach is collected.
  • segmentedGeometry (object) Geometry of the given approach, split by map segments. See the GeoJSON MultiLineString specification.
  • arrivalPoints[] (array) Applicable only for Enhanced Junction Analytics users Contains arrival points for approaches. Maximum number of arrival points: 3.
    • id (integer) The arrival point ID is unique in the approach context.
    • name (string) Name for an arrival Point.
    • userPoint Coordinates of point that the geometry routes through. See the GeoJSON Point specification.
    • projectedPoint Coordinates of point that the geometry routes through. See the GeoJSON Point specification.

exits[] (array) Contains junction exits. Minimum numbers of exits: 1. The details in this section are derived from the Junction Definition Preview.

Request headers

HeaderValue
Content-Typeapplication/json

Example request

The following is an example curl request:

put
curl command example
1$ curl '/junction-analytics/junctions/1/5fd8da2b84510126b9d18b0d/definition/manual?key={Your_API_Key}' -i -X PUT -d '{
2 "name": "Otto-Braun-Straße - Karl-Marx-Allee - Alexanderstraße",
3 "detectionConfig": {
4 "autodetectName": true
5 },
6 "junction": {
7 "type": "Feature",
8 "geometry": {
9 "type": "Point",
10 "coordinates": [
11 13.41649420385599,
12 52.52202006909155
13 ]
14 },
15 "properties": {
16 "radius": 51.30814890800801
17 }
18 },
19 "approaches": [
20 {
21 "id": -1194621510,
22 "segmentedGeometry": {
23 "type": "MultiLineString",
24 "coordinates": [
25 [
26 [
27 13.41808,
28 52.52377
29 ],
30 [
31 13.41775,
32 52.52348
33 ]
34 ],
35 [
36 [
37 13.41775,
38 52.52348
39 ],
40 [
41 13.41704,
42 52.52285
43 ]
44 ]
45 ]
46 },
47 "excluded": false
48 },
49 {
50 "id": 1275645260,
51 "segmentedGeometry": {
52 "type": "MultiLineString",
53 "coordinates": [
54 [
55 [
56 13.41958,
57 52.5212
58 ],
59 [
60 13.41889,
61 52.52141
62 ]
63 ],
64 [
65 [
66 13.41889,
67 52.52141
68 ],
69 [
70 13.41871,
71 52.52146
72 ]
73 ]
74 ]
75 },
76 "excluded": false
77 }
78 ],
79 "exits": [
80 {
81 "segmentedGeometry": {
82 "type": "MultiLineString",
83 "coordinates": [
84 [
85 [
86 13.41599,
87 52.52178
88 ],
89 [
90 13.41576,
91 52.52155
92 ]
93 ]
94 ]
95 }
96 },
97 {
98 "segmentedGeometry": {
99 "type": "MultiLineString",
100 "coordinates": [
101 [
102 [
103 13.41641,
104 52.52223
105 ],
106 [
107 13.41625,
108 52.5223
109 ]
110 ]
111 ]
112 }
113 }
114 ]
115}'

Response data

This response returns the junction ID and modification type.

Example response

The following JSON code block is an example response:

Response body - JSON
1{
2 "modificationType": "Updated",
3 "junctionId": "65268ff77cd5d952a185b9b5"
4}

Response fields

The following section describes all of the fields that can appear in a response.

modificationType (string) String that describes the modification type. In this case it has the value Updated.

junctionId (string) Unique ID of the updated junction.

Errors

The system generates an error response if there is an error in the supplied parameters or any other internal problem. This response is generated in the requested format.

Error response codes

The following table shows the HTTP error response codes.

CodeDescription
401

Unauthorized

403

Forbidden

400

Bad Request Example messages:

  • Junctions limit of 10 is reached. Remove some of your existing junctions or contact support.
  • junction field is required.
  • Name should be provided if detectionConfig.autodetectName is set to false!
  • Name should not be empty or consist of only whitespace!
  • Junction name TestJunction exceeded maximum length of 250.
  • We're having trouble creating the junction. This issue is noted in the system, please try later.
  • Maximum area of 1 km2 exceeded.
  • Maximum area boundary length of 3000 meters exceeded.
  • Maximum radius of 500 meters exceeded.
  • Circle radius can't be empty.
  • A junction that crosses countries is unsupported; attempted POL, DEU.

Error response field

FieldDescription

message
string

The problem description.

Example error response

The following is an example error response:

Response error message - JSON
1{
2 "message": "Name should be provided if detectionConfig.autodetectName is set to false!"
3}