Live traffic

This help topic provides conceptual information on how live traffic works. For an overview of traffic, read What is traffic data. For step-by-step instructions on how to configure live traffic, see Configuring traffic in a network dataset and tutorial exercise 10. For instructions on how to solve a network analysis using live traffic data, see Network analysis using traffic data and tutorial exercise 11.

How live traffic works

The network dataset reads live traffic speeds from dynamic traffic format (DTF) files and relates the speeds to edges using traffic message channel (TMC) codes. (TMC codes are standard unique identifiers that are supported by various organizations, including traffic data providers.) The following graphic and the text below illustrate and describe this process.

Generalized live-traffic
  1. The network dataset queries an edge for the current travel time. This happens when a network analysis layer is being solved or when traffic is being drawn on a map.

  2. The identifying source feature information (source feature class, source feature, and from-to and to-from position) is used to look up one or more TMC values. The lookup is performed with the information that was in the Streets-TMC Join Table at the time of the last network build. (The Streets-TMC Join Table simply relates streets to TMCs. It is described further in the next section.)

    Dive-inDive-in:

    The red box around the Streets-TMC Join Table in the diagram is there to highlight an oversimplification of the diagram. A network dataset doesn't directly reference the join table during the query process; that would be too slow. Instead, the information in the join table is built into the network dataset and referenced internally for faster processing. Consequently, any changes you make to the Streets-TMC table won't be incorporated into the network until it is rebuilt.

  3. The network dataset looks for a DTF file, which is a binary file designed for network datasets, and reads the travel speed information. The files are stored in a directory that you point the network dataset to using a local or UNC path. (You type the path in the traffic page of the New Network Dataset wizard or the Network Dataset Properties dialog box.)

    Each DTF file is marked with a valid time range and contains TMCs and their corresponding travel speeds for the given time span. The network dataset opens a DTF file only if the time and date that the edge is being queried for is within the DTF file's valid time range. In many cases, multiple DTF files have valid time ranges that are within the queried time. This can occur when live traffic includes traffic predictions of a given depth; for example, for the next 12 hours. If multiple, valid files exist for the queried time, the file that was created immediately before the queried time is opened.

    Dive-inDive-in:

    Only one DTF file is opened per solve. That is, if multiple, valid files exist, only one is used throughout the duration of that solve process. Whenever the solver queries an edge for a time and date that is outside the file's time range, it attempts to retrieve the travel time from historical traffic tables instead.

    If the DTF files are accessed via a geoprocessing service, a folder containing an index file and the DTF files that are downloaded is created in %AppData%\Roaming\ESRI\Local Caches\TrafficCache. The name of the folder is similar to the name of the geoprocessing service but modified to avoid using invalid file path characters. For example, the folder name starts with http___ instead of http:// because colons and slashes are replaced with underscores. The rest of the folder name resembles the rest of the service name in a similar way.

  4. Once the DTF file is opened, the TMC and its associated travel speeds are combined with the length of the queried edge to determine the actual travel time.

    If a valid TMC value or DTF file can't be found, the network dataset falls back to historical traffic to retrieve the travel time. And if historical travel times don't exist, it falls back to either a weekend- or weekday-specific network cost attribute, depending on what day of the week the edge is being queried for. This fallback sequence is set out in the edge traffic evaluators of the traffic-based cost attribute.

Creating DTF files

The far right side of the illustration above shows how DTF files are generated. A traffic feed, which is a web service and typically provided by a data vendor, is accessed using the Update Traffic Data geoprocessing tool. The tool reads data from the traffic feed and translates and stores the information into a DTF file, which is then saved to a file system folder.

The travel speeds in the DTF file are current at the time the file is created. To ensure the latest traffic data is available, run Update Traffic Data frequently or automate the generating of DTF files. One way to automatically generate new DTF files at fixed intervals, such as every 5 minutes, is by creating a Python script that runs Update Traffic Data, then run the script at regular intervals using Windows Task Scheduler.

The folder where the DTF files are stored can be shared and accessed locally via a UNC or local path.

Streets-TMC join table

The Streets-TMC join table furnishes the information needed to relate edges to speed values that are stored in DTF files. Typically, this table is provided by a data vendor along with street data.

The table below lists the required fields of a Streets-TMC join table, an example field name, their allowed data types, and a short description.

NoteNote:

The Network Analyst tutorial data, which is available on ArcGIS.com, includes a San Diego network dataset with a Streets-TMC table for your reference. After downloading and extracting the data, you can find the SanDiego geodatabase at \Network Analyst\Tutorial\SanDiego.gdb.

Field

Field name examples

Data type

Description

Edge feature class identifier

EdgeFCID

You must name this field EdgeFCID.

Long integer

Identifies the feature class in which the street feature is stored.

Edge feature identifier

EdgeFID

You must name this field EdgeFID.

Long integer

Identifies the street feature.

Edge from position

EdgeFrmPos

You must name this field EdgeFrmPos.

Double

Works in conjunction with EdgeToPos to identify a direction of travel or side of the street. Zero indicates the beginning of the line feature as defined by its digitized direction. One indicates the opposite end.

For example, an EdgeFrmPos value of 0 and an EdgeToPos value of 1 would identify travel in the digitized direction of the line feature. The TMC value listed in the same record would represent that side of the street only.

Any decimal values specify a position along the digitized direction of the feature, which allows the Dissolve Network tool to maintain the proper TMC values for streets after edges have been dissolved together.

Edge to position

EdgeToPos

You must name this field EdgeToPos.

Double

Works in conjunction with EdgeFrmPos to identify a direction of travel, or side of the street.

TMC code

TMC

String

The TMC code representing the associated road segment.

Overview of setting up and updating live traffic data

The following list provides an overview of what you need to do prior to setting up live traffic.

Learn how to configure live traffic in a new network dataset

Related Topics

7/2/2014