Junction Analytics Tools
Junction Analytics Tools
Monitor traffic flow at intersections with real-time and historical data. These tools let you search your junction inventory, check live congestion metrics, and download historical archives for trend analysis.
- Documentation: Junction Analytics
- Uses
TOMTOM_MOVE_PORTAL_KEY
tomtom-junction-search
Search and filter all junctions by name, status, country, or other properties.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
view | enum | No | compact (default) or full. Compact returns the junctions table only. Full adds approaches and exits tables |
sql_queries | object | Yes | Named SQL queries |
SQL Tables
junctions: Always available
| Column | Type | Description |
|---|---|---|
junction_id | string | Unique junction identifier |
name | string | Junction name |
status | string | ACTIVE, PENDING_UPDATE, or ERROR |
country_code | string | ISO 3166-1 alpha-3 code (e.g., ESP, DEU, USA, GBR) |
drive_on_left | number | 0 or 1 |
traffic_lights | number | 0 or 1 |
num_approaches | number | Number of approaches |
num_exits | number | Number of exits |
created_at | string | Creation timestamp |
last_modified_at | string | Last modification timestamp |
time_zone | string | Timezone identifier |
approaches: Full view only
| Column | Type | Description |
|---|---|---|
junction_id | string | Reference to junction |
approach_id | number | Approach identifier |
name | string | Approach name |
road_name | string | Road name |
direction | string | NORTH, SOUTH, EAST, WEST |
frc | number | Functional road class (0–7) |
length | number | Length in meters |
one_way_road | number | 0 or 1 |
excluded | number | 0 or 1 |
drivable | number | 0 or 1 |
exits: Full view only
| Column | Type | Description |
|---|---|---|
junction_id | string | Reference to junction |
exit_id | number | Exit identifier |
name | string | Exit name |
road_name | string | Road name |
direction | string | NORTH, SOUTH, EAST, WEST |
frc | number | Functional road class (0–7) |
one_way_road | number | 0 or 1 |
drivable | number | 0 or 1 |
Example SQL Queries
-- Find junctions by nameSELECT junction_id, name, country_code FROM junctions WHERE name ILIKE '%highway%'
-- Count junctions by countrySELECT country_code, COUNT(*) as count FROM junctions GROUP BY country_code ORDER BY count DESC
-- Find junctions by road name (full view)SELECT j.junction_id, j.name, a.road_nameFROM junctions jJOIN approaches a ON j.junction_id = a.junction_idWHERE a.road_name ILIKE '%Main%'tomtom-junction-live-data
Access real-time traffic metrics for junctions, including delays, queue lengths, stops, turn ratios, and volume. Supports up to 20 junctions per request for cross-junction comparisons.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
junctionIds | string[] | Yes | Junction IDs to query (1–20). Data is merged for cross-junction SQL |
includeGeometry | boolean | No | Set true to populate metadata tables with junction geometry |
sql_queries | object | Yes | Named SQL queries |
SQL Tables
approaches: Real-time metrics per approach
| Column | Type | Description |
|---|---|---|
junction_id | string | Junction ID |
approach_id | number | Approach identifier |
travel_time_sec | number | Travel time in seconds |
free_flow_travel_time_sec | number | Free flow travel time |
delay_sec | number | Delay in seconds |
usual_delay_sec | number | Usual delay in seconds |
stops | number | Number of stops |
queue_length_meters | number | Queue length |
volume_per_hour | number | Traffic volume per hour |
is_closed | number | 0 or 1 |
turn_ratios: Turn distribution at junction
| Column | Type | Description |
|---|---|---|
junction_id | string | Junction ID |
approach_id | number | Approach identifier |
exit_id | number | Exit identifier |
exit_index | number | Exit index |
ratio_percent | number | Turn ratio as percentage |
probes_count | number | Number of probe samples |
stops_histogram: Distribution of stop counts
| Column | Type | Description |
|---|---|---|
junction_id | string | Junction ID |
approach_id | number | Approach identifier |
number_of_stops | number | Stop count bucket |
number_of_vehicles | number | Vehicle count in bucket |
junction_metadata, approach_metadata, exit_metadata: Available when includeGeometry is true. Contains the same columns as the junction search tables plus geometry data.
Example SQL Queries
-- Most delayed approachesSELECT junction_id, approach_id, delay_sec, queue_length_metersFROM approachesORDER BY delay_sec DESCLIMIT 5
-- Turn ratios for a specific approachSELECT exit_id, ratio_percentFROM turn_ratiosWHERE approach_id = 1ORDER BY ratio_percent DESC
-- Compare junctions by average delaySELECT junction_id, ROUND(AVG(delay_sec), 2) as avg_delayFROM approachesGROUP BY junction_idORDER BY avg_delay DESCtomtom-junction-archive
Download minute-by-minute historical traffic data for junctions over a date range (maximum 2 days). Supports up to 20 junctions per request.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
junctionIds | string[] | Yes | Junction IDs to query (1–20). Data is merged for cross-junction SQL |
from | string | Yes | Start date (YYYY-MM-DD) |
to | string | No | End date (YYYY-MM-DD). Maximum 2-day range from start |
sql_queries | object | Yes | Named SQL queries |
SQL Tables
approaches: Historical approach metrics with timestamps
| Column | Type | Description |
|---|---|---|
time | string | ISO timestamp |
junction_id | string | Junction ID |
approach_id | string | Approach identifier |
travel_time_sec | number | Travel time in seconds |
free_flow_travel_time_sec | number | Free flow travel time |
delay_sec | number | Delay in seconds |
usual_delay_sec | number | Usual delay in seconds |
stops | number | Number of stops |
queue_length_meters | number | Queue length |
volume_per_hour | number | Traffic volume per hour |
is_closed | number | 0 or 1 |
turn_ratios: Historical turn ratios with timestamps
| Column | Type | Description |
|---|---|---|
time | string | ISO timestamp |
junction_id | string | Junction ID |
approach_id | string | Approach identifier |
exit_id | string | Exit identifier |
exit_index | number | Exit index |
ratio_percent | number | Turn ratio as percentage |
probes_count | number | Probe sample count |
Example SQL Queries
-- Hourly average delaysSELECT date_part('hour', time::TIMESTAMP) as hour, ROUND(AVG(delay_sec), 2) as avg_delay, MAX(delay_sec) as max_delayFROM approachesGROUP BY hourORDER BY hour
-- Peak congestion periodsSELECT time::DATE as day, date_part('hour', time::TIMESTAMP) as hour, ROUND(AVG(delay_sec), 2) as avg_delayFROM approachesWHERE delay_sec > 30GROUP BY day, hourORDER BY avg_delay DESCLIMIT 10