Live Traffic Data


Provides information about the live traffic information stored in the network dataset such as the streets—TMC join table and the path to the DTF files.


PropiedadExplicaciónTipo de datos
(Sólo lectura)

The name of the table that contains the relationship between streets and traffic messaging channel (TMC) codes.

(Sólo lectura)

The name of the field in the Streets—TMC join table that contains the TMC codes.

(Sólo lectura)

The source of the live traffic feed.

If the trafficFeedType is FOLDER, this property returns the catalog path to the folder where .dtf files are stored. The network dataset reads the .dtf files from the specified location to get the live traffic data.

If the trafficFeedType is SERVICE, this property returns a JSON string containing the connection properties of the traffic service, such as the service URL and the region to which the service applies.

Example of the returned value for a service.


(Sólo lectura)

Specifies the type of live traffic feed. Options are the following:

  • SERVICE—The traffic feed uses a service.
  • FOLDER—The traffic feed uses a folder that stores .dtf files.
  • NONE—The traffic feed is not currently configured.


Muestra de código

Live Traffic Data Properties example

Display a summary of the live traffic information for the network dataset.

# Name:
# Description: Print live traffic information for the network dataset.

import arcpy
import sys

# Set the workspace
arcpy.env.workspace = "C:/Data/SanDiego.gdb/Transportation"

# Create Describe object for the network dataset
desc = arcpy.Describe("Streets_ND")

#Get the historical traffic data object
if desc.supportsLiveTrafficData:
    traffic = desc.liveTrafficData
    #If the directions are not set for the network dataset, exit
    print "No live traffic information"

print("Live Traffic Information ----")
print("TMC Table Name: " , traffic.tmcTableName)
print("TMC Field Name: " , traffic.tmcFieldName)
print("Traffic Feed: " , traffic.trafficFeedLocation)