Junction Analytics API

Junction manual update

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
{
"name": "Otto-Braun-Straße - Karl-Marx-Allee - Alexanderstraße",
"detectionConfig": {
"autodetectName": true
},
"junction": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
13.41649420385599,
52.52202006909155
]
},
"properties": {
"radius": 51.30814890800801
}
},
"approaches": [
{
"id": -1194621510,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41808,
52.52377
],
[
13.41775,
52.52348
]
],
[
[
13.41775,
52.52348
],
[
13.41704,
52.52285
]
]
]
},
"excluded": false
},
{
"id": 1275645260,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41958,
52.5212
],
[
13.41889,
52.52141
]
],
[
[
13.41889,
52.52141
],
[
13.41871,
52.52146
]
]
]
},
"excluded": false
}
],
"exits": [
{
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41599,
52.52178
],
[
13.41576,
52.52155
]
]
]
}
},
{
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41641,
52.52223
],
[
13.41625,
52.5223
]
]
]
}
}
]
}

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
{
"name": "My junction name",
"detectionConfig": {
"autodetectName": true
},
"junction": {
"type": "Feature",
"properties": {
"radius": 20
},
"geometry": {
"type": "Point",
"coordinates": [
13.46555,
52.51732
]
}
},
"approaches": [
{
"id": 277814775,
"name": "Samariterstraße South Bound",
"roadName": "Samariterstraße",
"direction": "SOUTH",
"frc": 6,
"length": 342.55,
"oneWayRoad": false,
"excluded": false,
"drivable": true,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.46219,
52.51872
],
[
13.46519,
52.51816
],
[
13.46565,
52.51807
],
[
13.46576,
52.51804
],
[
13.4658,
52.51803
],
[
13.46584,
52.518
],
[
13.46587,
52.51797
]
],
[
[
13.46587,
52.51797
],
[
13.46566,
52.51755
],
[
13.46553,
52.51731
]
]
]
},
"openlr": "CwmSrSVYwTLJBgFl/24zQQs=",
"dataNotAvailable": false,
"arrivalPoints": [
{
"id": 0,
"name": "350_FT",
"userPoint": {
"type": "Point",
"coordinates": [
13.465503,
52.518099
]
}
},
{
"id": 1,
"name": "40_FT",
"userPoint": {
"type": "Point",
"coordinates": [
13.465586,
52.517414
]
}
},
{
"id": 2,
"name": "0_FT",
"userPoint": {
"type": "Point",
"coordinates": [
13.46553,
52.51731
]
}
}
]
}
],
"exits": [
{
"id": -1987666488,
"name": "Samariterstraße South Bound",
"roadName": "Samariterstraße",
"direction": "SOUTH",
"frc": 7,
"oneWayRoad": false,
"drivable": true,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.46553,
52.51731
],
[
13.46544,
52.51709
],
[
13.4651,
52.51638
]
]
]
},
"openlr": "CwmTVCVYfTvxAf/V/6M7AQ=="
}
]
}

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-Type application/json

Example request

The following is an example curl request:

put
curl command example
$ curl 'https://api.tomtom.com/junction-analytics/junctions/1/5fd8da2b84510126b9d18b0d/definition/manual?key={Your_API_Key}' -i -X PUT -d '{
"name": "Otto-Braun-Straße - Karl-Marx-Allee - Alexanderstraße",
"detectionConfig": {
"autodetectName": true
},
"junction": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
13.41649420385599,
52.52202006909155
]
},
"properties": {
"radius": 51.30814890800801
}
},
"approaches": [
{
"id": -1194621510,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41808,
52.52377
],
[
13.41775,
52.52348
]
],
[
[
13.41775,
52.52348
],
[
13.41704,
52.52285
]
]
]
},
"excluded": false
},
{
"id": 1275645260,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41958,
52.5212
],
[
13.41889,
52.52141
]
],
[
[
13.41889,
52.52141
],
[
13.41871,
52.52146
]
]
]
},
"excluded": false
}
],
"exits": [
{
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41599,
52.52178
],
[
13.41576,
52.52155
]
]
]
}
},
{
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
13.41641,
52.52223
],
[
13.41625,
52.5223
]
]
]
}
}
]
}'

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
{
"modificationType": "Updated",
"junctionId": "65268ff77cd5d952a185b9b5"
}

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
{
"message": "Name should be provided if detectionConfig.autodetectName is set to false!"
}