Network Directions (arcpy)

摘要

网络数据集的网络方向对象提供了有关网络数据集级别的方向设置信息,例如用于生成方向的输出长度单位或长度属性。

属性

属性说明数据类型
lengthAttributeName
(只读)

The name of the network attribute to be used for reporting travel distances.

String
timeAttributeName
(只读)

The name of the network attribute to be used for reporting travel time.

String
roadClassAttributeName
(只读)

The name of the network attribute to be used for road classification.

String
defaultOutputLengthUnits
(只读)

The default length units that will be used for reporting distances in driving directions.

String
signpostFeatureClassName
(只读)

The name of the feature class containing the signposts.

String
signpostStreetsTableName
(只读)

The name of the indexed table containing signpost street references.

String

代码实例

网络方向属性示例

显示网络数据集方向信息的摘要。

# Name: NDSDirectionProperties_ex01.py
# Description: Print direction setting for the network dataset.

import arcpy
import sys

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

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

#Get the direction object
if desc.supportsDirections:
    direction = desc.directions
else:
    #If the directions are not set for the network dataset, exit 
    print "No direction information"
    sys.exit() 

print "Direction Information ----" 
print "Length attribute name: " , direction.lengthAttributeName 
print "Time attribute name: " , direction.timeAttributeName 
print "Road Class attribute name: " , direction.roadClassAttributeName 
print "Default Output Length Units: " , direction.defaultOutputLengthUnits 
print "Signpost Feature Class: " , direction.signPostFeatureClassName 
print "Signpost Streets Table: " , direction.signpostStreetsTableName
5/10/2014