Junction Analytics API

Junction manual creation

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.

Enhanced Junction Analytics Users If the Enhanced Junction Analytics option is active on your account, by default, the system will automatically add predefined arrival points if you choose not to specify your own. If you prefer to configure custom arrival points, you can do so by utilizing the designated endpoint.

Purpose

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

Features

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

Workflow

  1. Junction Definition Preview:

    • Before proceeding with the manual creation 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 Creation request.
  3. Receive Response:

    • Upon successful submission, the response will provide a unique junction ID.

Request data

To manually create the junction, issue a POST 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: POST

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

POST request body example

post
POST 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
]
]
]
}
}
]
}

POST request body example for enhanced access enabled

Request body - JSON
{
"name": "Treat Blvd - San Simeon Dr",
"junction": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-122.018304,
37.943143
]
},
"properties": {
"radius": 20
}
},
"approaches": [
{
"id": -1820173215,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
-122.01619,
37.94464
],
[
-122.01628,
37.94458
],
[
-122.01725,
37.94392
]
],
[
[
-122.01725,
37.94392
],
[
-122.01828,
37.94323
]
]
]
},
"arrivalPoints": [
{
"id": 0,
"name": "stop line",
"userPoint": {
"type": "Point",
"coordinates": [
-122.01828,
37.94323000000001
]
},
"projectedPoint": {
"type": "Point",
"coordinates": [
-122.01828,
37.94323000000001
]
}
},
{
"id": 12,
"name": "40ft",
"userPoint": {
"type": "Point",
"coordinates": [
-122.01817410432558,
37.94330094083544
]
},
"projectedPoint": {
"type": "Point",
"coordinates": [
-122.01817410432558,
37.94330094083544
]
}
},
{
"id": 106,
"name": "350ft",
"userPoint": {
"type": "Point",
"coordinates": [
-122.01735340594522,
37.943850729049636
]
},
"projectedPoint": {
"type": "Point",
"coordinates": [
-122.01735340594522,
37.943850729049636
]
}
}
]
}
],
"exits": [
{
"id": 1474468109,
"segmentedGeometry": {
"type": "MultiLineString",
"coordinates": [
[
[
-122.01818,
37.94313
],
[
-122.01761,
37.94352
]
]
]
}
}
]
}

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

key
string

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

POST request body fields

name (string) Name for a newly created 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 creation.

  • autodetectName (boolean) If true, the junction name will be created 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 creation process.

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

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 .

Request headers

HeaderValue
Content-Type application/json

Example request

The following is an example curl request:

post
curl command example
$ curl 'https://api.tomtom.com/junction-analytics/junctions/1/definition/manual?key={Your_API_Key}' -i -X POST -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": "Created",
"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 value Created.

junctionId (string) Unique ID of the created 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
401Unauthorized
403Forbidden
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!"
}