Live Traffic Data
汇总
提供有关网络数据集中存储的实时流量数据的信息,如街道 - TMC 连接表和 DTF 文件的路径。
属性
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
tmcTableName (只读) |
包含街道与流量消息通道 (TMC) 代码之间关系的表的名称。 |
String |
|
tmcFieldName (只读) |
包含 TMC 代码的街道-TMC 连接表中的字段名称。 |
String |
|
trafficFeedLocation (只读) |
实时流量源的来源。 如果 如果 服务的返回值示例。
|
String |
|
trafficFeedType (只读) |
指定实时流量源的类型。选项如下:
|
String |
代码示例
实时流量数据属性示例
显示网络数据集实时流量信息的摘要。
# Name: NDSLiveTrafficDataProperties_ex01.py
# 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
else:
#If the directions are not set for the network dataset, exit
print("No live traffic information")
sys.exit()
print("Live Traffic Information ----")
print("TMC Table Name: " , traffic.tmcTableName)
print("TMC Field Name: " , traffic.tmcFieldName)
print("Traffic Feed: " , traffic.trafficFeedLocation)