Traffic Flow - DatexII
Purpose
The TomTom Traffic Flow – Intermediate Service – DATEX II (hereafter called 'Service') is designed for server to server integration with traffic control center, routing, navigation, and mapping applications. It contains real-time travel times and speeds for segments based on TomTom's Traffic technology with several possible configurations.
In this document, we discuss how to access the service endpoint and the features that are included. TomTom only supports the Intermediate Service with the use of the TomTom customized DATEX II schema , available for download from our website (linked previously and later in this document). Using the Service with the standard DATEX II schema will disable the functionality that is included with the Service. Therefore, the standard DATEX II schema is not supported.
Scope
This page gives basic information on the Service and shows you how to configure this to work with your environment. Basic knowledge of installing and using XML-based schemas is necessary.
Intended audience
This information is intended to be used by TomTom partners and customers (decision makers and developers).
Standard configurations
TomTom offers traffic flow data to customers. The most basic data type is speed information and travel times, by segment. TomTom configures a custom product based upon your specific needs. The product is static, so included regions and features are fixed once the product is configured.
Optional configurations
The Service gives users traffic flow data with highly customizable configuration options. When the product is configured, there are some additional options that could be enabled, depending on your specific preferences.
Option | Description |
---|---|
Relative speed | When enabled, the relative speed is provided. This is defined as the ratio of average speed to free-flowing speed (for example, 0.250 indicates a current real-time speed that is 25% of freeflow speed). |
Traffic condition | When enabled, the current traffic condition is given. This is expressed by one of up to seven available values, for example, heavyTraffic or stationaryTraffic. |
Miles per hour | The average speed is additionally provided in mph (all speeds are provided by default in km/h). |
Map version | Provides names and versions of the maps that were used to create the content. |
Request data
The Service uses RESTful API (Representation State Transfer) technology. Because you only need to use one URL, the endpoint is simple to use.
'Simple HTTP server' profile
The interface supports the client pull method, also known as the simple HTTP server profile. The profile is described in the Software Developers Guide and Exchange Platform Specific Model (see the DATEX II payload specification for the links to the documents). TomTom does not support the SOAP envelope, as described in the Software Developers Guide.
Important
To use this service, ensure that all prerequisites are met as described in the section A secure connection or at Authentication for client certificate access.
How do you make a request?
To make a request, the URL should be constructed as shown in the following sections.
HTTPS Method: GET
For ease of viewing and identification:
- 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 parameters tables for their values. The generic request format is as follows.
The sample URL is formatted as follows:
https://{baseURL}/tsq/hdf/{productName}/{apiKey}/content.xml[?flowType={flowType}]
The following is an example URL request:
https://cert-traffic.tomtom.com/tsq/hdf/DEU-HDF-OPENLR/{Your_API_Key}/content.xml
The following is an example cURL request:
curl -XGET 'https://cert-traffic.tomtom.com/tsq/hdf/DEU-HDF-OPENLR/{Your_API_Key}/content.xml'
Request parameters
The following table provides a detailed explanation of the available fields that were previously
shown in the HTTPS Method: GET
section.
Required parameters | Description |
---|---|
| Base URL for calling the API. |
| Name of the product (feed) you are requesting. These will be indicated
to you as part of the provisioning process. Typically, it explains the
country (country code), type of feed (HDF is the flow feed) and the
location referencing method (TMC or OpenLR). |
| Authorization key for access to the API. |
Optional parameters | Description |
---|---|
| When the feed is requested without the parameter
There are two values supported for this parameter:
When using this parameter, at the first request the free-flow information should be downloaded. Afterwards, non-free-flow information can be downloaded for each future request. The free-flow and non-free-flow data are related. The segments for both files should be in sync, otherwise there is a mismatch in the locations of the free-flow data. Therefore, every time the non-free-flow information is downloaded, it
must be checked. This insures that the non-free-flow data corresponds to
the freeflow data (that the user already has). The verification is done
by confirming the If the |
HTTP headers
Since flow feeds can be very large, TomTom recommends optimizing the information transmission as much as possible. By doing this, the client receives more up-to-date information.
Headers | Description |
---|---|
If-Modified-Since | TomTom recommends using the standard HTTP header |
Accept-Encoding | The TomTom Traffic Incidents bulk feed supports gzip compression of all
response types. However, responses are compressed only when the
requester states gzip support. This should be specified through the
standard HTTP header |
Response data
Response example
This is the response you receive after a request is made. If you make the following request:
https://cert-traffic.tomtom.com/tsq/hdf/DEU-HDF-OPENLR/<APIKEY>/content.xml?flowType=nff
You can expect the following response:
1<?xml version="1.0"?>2<d2LogicalModel xmlns="http://datex2.eu/schema/1_0/1_0" modelBaseVersion="1.0">3 <exchange>4 <supplierIdentification>5 <country>nl</country>6 <nationalIdentifier>TomTom Traffic Service</nationalIdentifier>7 </supplierIdentification>8 </exchange>9 <payloadPublication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"10 xsi:type="ElaboratedDataPublication" lang="en">11 <publicationTime>2015-12-23T11:54:00Z</publicationTime>12 <publicationCreator>13 <country>other</country>14 <nationalIdentifier>db14af1d-3827-4d61-8525-8f70bc1c5b3f15e87601</nationalIdentifier>15 </publicationCreator>16 <headerInformation>17 <confidentiality>internalUse</confidentiality>18 <informationStatus>real</informationStatus>19 </headerInformation>20 <referenceSettings>21 <locationSetReference/>22 </referenceSettings>23 <elaboratedData id="Ob719eb226ba9b25e44b15b17">24 <basicDataValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TravelTimeValue">25 <supplierCalculatedDataQuality>95.0</supplierCalculatedDataQuality>26 <affectedLocation>27 <locationContainedInGroup xsi:type="LocationByReference">28 <locationExtension>29 <openlr>30 <binary>CwcZ6yJrqQslDgRLAQULFw==</binary>31 </openlr>32 </locationExtension>33 <predefinedLocationReference>OpenLR</predefinedLocationReference>34 </locationContainedInGroup>35 </affectedLocation>36 <travelTime>346.0</travelTime>37 <travelTimeValueExtension>38 <averageSpeed>9.0</averageSpeed>39 <relativeSpeed>0.257</relativeSpeed>40 <trafficCondition>queuingTraffic</trafficCondition>41 </travelTimeValueExtension>42 </basicDataValue>43 </elaboratedData>44 [...]45 </payloadPublication>46</d2LogicalModel>
Response – DATEX II payload specification (analysis of the output received)
The payload in the output is formatted as DATEX II, which is a European standard for the exchange of Traffic and Travel Information. TomTom supports version 1. Recommended documents are:
- DATEX II v1.0 User Guide version 1.0 ( DATEXIIv1.0-UserGuide_v1.0.pdf )
- DATEX II v1.0 Software Developers Guide version 1.0 ( DATEXIIv1.0-DevGuide_v1.0.pdf )
- DATEX II v1.0 Exchange Platform Specific Model version 1.0 ( DATEXIIv1.0-ExchangePSM_v1.0.pdf )
- A browsable DATEX II version 1.0 data dictionary ( DATEXIIv1.0-DataDictionnary_v1.0.zip )
The Elaborated Data Publication, used by TomTom, is described in more detail in section 4.11 of the DATEX II User Guide version 1.0.
Important: XSD schema
TomTom extended the data model with additional fields; the full XSD schema including extensions can be downloaded by clicking this Level B extension. It is a "Level B" extension of the standard XML schema: DATEXIISchema_1_0_1_0.xsd. Such an extension is interoperable with the "Level A" data model (see section 2.2.3 in the DATEX II User Guide version 1.0 for more information).
Standard information
The following table shows the fields offered in our standard configuration. The features are standard DATEX II elements and TomTom specific extensions. For our purposes, 'congestion' is defined as traffic that may cause a non-freeflow condition.
Field Name (part of) | Description |
---|---|
| The definition of a segment of a road in a particular direction. The segment identifier. See the Geographical representation. |
| Current average travel time in seconds based on real-time measurements
on the affectedLocation. Only provided in case of congestion. See
|
| Current average speed on the affectedLocation, in km/h, directly based
on the |
| The travel time in seconds that is expected under ideal freeflow
conditions. Only provided in case of free flow conditions. See
|
| The freeflow speed in km/h that is expected under ideal freeflow
conditions, corresponding to the |
| A measure of data quality assigned to the value by the supplier. 100%
equates to perfect quality. See |
Freeflow
For every segment, an estimate is made whether traffic is flowing freely or whether it is congested.
If traffic is flowing freely, the actual travel time depends on the type of vehicle and the speed
driven. The actual speeds on each segment can differ greatly. In this case, the TravelTimeValue
will
contain the freeFlowSpeed
and freeFlowTravelTime
. If traffic is not flowing freely, it
is considered congested, and a driver cannot choose the speed anymore. In that case, the TravelTimeValue
will contain the travelTime
and averageSpeed
.
TravelTime and averageSpeed
The <travelTime>
contains an estimate of the real-time travel time between the start and the end
of the affected location. It is the instantaneous travel time, which means that it is the sum of the
travel time estimations on the individual road segments of the affected location. Note that this may
differ from the actual travel time, when measured from the start to the end of the affected
location (especially for longer segments).
The reason for this difference is because the travel time
estimate is based on both real-time measurements and historic data. It provides speeds by the day of
the week and the time of day. The averageSpeed
is directly derived from the provided
travelTime and the length of the affectedLocation. Therefore, the
supplierCalculatedDataQuality
also applies to this value.
If the affected location is closed, the averageSpeed
is set to 0 km/h and the travelTime
refers to
the travel time under freeflow conditions.
FreeFlowTravelTime and freeFlowSpeed
The freeFlowTravelTime
is directly derived from the freeFlowSpeed
and the length of the
affectedLocation
. The freeFlowSpeed
is the expected speed under freeflow conditions, based
on historic data. It is averaged over different vehicle types. The value is capped by the speed
limit.
SupplierCalculatedDataQuality
This field contains a quality measure for the provided travel time and speed. It is based on the following variables:
- The number of real-time measurements from devices driving the affected locations at the moment.
- The standard deviation of the measurements.
- The percentage of the affected location that is covered with measurements.
- Compatibility of measurements with historic data.
- The age of the measurements.
When we determine that an insufficient amount of real-time measurements are available, historic data
is given a greater weight in the travel time estimate. If the value of
supplierCalculatedDataQuality
is below 60% (0.6), then the historic data holds greater
importance in the calculation. A value of 50% (0.5) implies that the provided travel time is based
only on the historic speed profile.
Optional information
The DATEX II data model has been extended to allow additional parameters. The service endpoint has the following possible extensions. Additional details are shown in Optional.
Option | Implementation |
---|---|
Miles per hour | Average speed in miles per hour. This feature is represented by the element averageSpeedInMPH provided in the complex type TravelTimeValueExtensionType. |
Relative speed | The relative speed is the relationship between the average speed and the freeflow speed. The range is from 0 to 1 and is precise to three decimal places. If the ,relativeSpeed value is 0 , the actual average speed is 0. If the relativeSpeed value is 1 , then the average speed and freeflow speed are equal. This feature is represented by the element relativeSpeed provided in the complex type TravelTimeValueExtensionType . This field is only provided in case of congestion. |
Traffic condition | Traffic status according to the relative speed of the location. It is represented by the element
|
Map version | This feature is supported by element
|
Geographical representation
Geographical representation of the road segments is an important part of the payload. There are two geographical representations that are supported: TMC and OpenLR. Since OpenLR prevents interpretation differences, licensing costs, map dependencies, or version dependencies, TomTom recommends using OpenLR instead of TMC. TMC based data is still offered for customers with existing platforms that need compatibility with their legacy systems.
The data type of the affectedLocation
in the schema is a Group of Locations. LocationByReference
is
the location method used, and it contains the identifier of a predefinedLocationReference
. If we use
TMC, the predefinedLocationReference
is a TMC link identifier. If we use OpenLR, the actual location
reference information is provided in TomTom’s proprietary extension LocationExtensionType
and the
predefinedLocationReference
is constantly set to “OpenLR.”
Location referencing method | Example |
---|---|
OpenLR |
|
TMC |
|
OpenLR is an open source location referencing system for all roads. OpenLR is a dynamic location reference method that can reference the complete digital map. The location references use the binary format version 3 that is described in the OpenLR White Paper. An open source reference implementation can be downloaded on the OpenLR website (www.openlr.org). TomTom also offers support for third parties to implement and test their own implementation.
Traffic Message Channel (TMC)
When using TMC as a geographical representation, travel times are measured by a TMC link. A TMC link is part of a TMC path. A TMC link is a sequence of road elements that starts at a TMC location, and ends at a next TMC location in the TMC table in the specified direction. You can recognize a TMC link by:
- TMC table (CountryCode, LocationTableNumber, version).
- A primary TMC location, defining the TMC point location at the end of the TMC link.
- A direction, as defined by the TMC path.
- An optional extent (the default value is
1
).
Generally, the set of TMC link identifiers that can be used in an ElaboratedDataPublication
is
static. That means that in subsequent ElaboratedDataPublications
, the same locations will be used.
However, this is not always the situation. Sometimes, the set of the used TMC link identifiers can
be changed. This occurs when a new TMC table is introduced.
referenceSettings
For TMC–based data, the referenceSettings
contain a locationSetReference
. Here, a reference is
made to a specific version of a TMC location table. The format is: A + BB + "v" + C + "." + D
,
where:
A
= the Country Code (hex format).BB
= the Location Table Number (2 digits).C
= the major version number (1 or 2 digits).D
= the minor version number (1 or 2 digits).
Example:
1<referenceSettings>2 <locationSetReference>D01v7.1</locationSetReference>3</referenceSettings>
TMC link identifier
In TMC–based DATEXII, TMC chain information includes the following parts ACVVDLLLLL[xE[E]]
:
Part | Description |
---|---|
| Fixed letter 'L' |
| Hexadecimal country code as described in IEC 62106. |
| TMC Location Table code |
| TMC direction of the chain (defined by the TMC path). For possible values, see TMC direction. |
| TMC point location code. If the number is not five digits long, zeros are added at the beginning until there are five digits. |
| Either empty, when extent = 1, or fixed letter 'x' followed by the extent (one or two digits). |
Using the specified TMC table, the secondary location (start of the stretch) can be found from the primary location, the direction and the extent. C, VV and LLLLL correspond to the TMC Location Reference, which is a unique identifier for a TMC location.
TMC direction
The possible values for D
infer the direction of travel (secondary to primary location) along the
TMC path.
Value | Direction |
---|---|
| Positive |
| Negative |
Examples
In this section, we demonstrate how to resolve TMC link identifiers on the receiver side. Here, we map the definition of each of the fields within the link identifier, and provide guidance on using the extent to find the secondary location.
Example 1: L817n39984x2
Given the TMC location data:
- Country code: 8
- Location table number: 17
- Direction from secondary to primary location: negative
- Primary location ID: 39984
- Extent: 2
Interpret the TMC location data to resolve the secondary location:
- Invert direction: negative → positive.
- Since the resolved direction is positive, follow the positive offset path for 39984 in TMC table for two extents.
- You will find the subsequent positive offsets are 39985 and 39986, hence, the resolved secondary location is 39986.
Example 2: LD01p27442
Given the TMC location data:
- Country code: D
- Location table number: 1
- Direction from secondary to primary location: positive
- Primary location ID: 27442
- Extent: 1 (if the extent is not provided explicitly then it is 1)
Interpret the TMC location data to resolve the secondary location:
- Invert direction: positive → negative.
- Since the resolved direction is negative, follow the negative offset path for 27442 in the TMC table for one extent.
- You will find the subsequent negative offset is 30080.
Predefined Location Product
In DATEX II, a PredefinedLocationsPublication
is used to predefine a set of locations, that can then
be referred to in the elaboratedDataPublication
. This allows for simplification of the
elaborated data publication, where typically, the elaborated data is published for a fixed set of
locations that is then published separately. However, since there is a straightforward relationship
between the predefined location reference we use, and the corresponding TMC link, the Predefined
Location Product is not published.