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
Recommended workflow: Use
tomtom-junction-searchfirst to discover junction IDs, then pass them totomtom-junction-live-dataortomtom-junction-archivefor traffic analysis.
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
1-- Find junctions by name2SELECT junction_id, name, country_code FROM junctions WHERE name ILIKE '%highway%'34-- Count junctions by country5SELECT country_code, COUNT(*) as count FROM junctions GROUP BY country_code ORDER BY count DESC67-- Find junctions by road name (full view)8SELECT j.junction_id, j.name, a.road_name9FROM junctions j10JOIN approaches a ON j.junction_id = a.junction_id11WHERE 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
1-- Most delayed approaches2SELECT junction_id, approach_id, delay_sec, queue_length_meters3FROM approaches4ORDER BY delay_sec DESC5LIMIT 567-- Turn ratios for a specific approach8SELECT exit_id, ratio_percent9FROM turn_ratios10WHERE approach_id = 111ORDER BY ratio_percent DESC1213-- Compare junctions by average delay14SELECT junction_id, ROUND(AVG(delay_sec), 2) as avg_delay15FROM approaches16GROUP BY junction_id17ORDER BY avg_delay DESC
tomtom-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
1-- Hourly average delays2SELECT date_part('hour', time::TIMESTAMP) as hour,3 ROUND(AVG(delay_sec), 2) as avg_delay,4 MAX(delay_sec) as max_delay5FROM approaches6GROUP BY hour7ORDER BY hour89-- Peak congestion periods10SELECT time::DATE as day,11 date_part('hour', time::TIMESTAMP) as hour,12 ROUND(AVG(delay_sec), 2) as avg_delay13FROM approaches14WHERE delay_sec > 3015GROUP BY day, hour16ORDER BY avg_delay DESC17LIMIT 10