Turn Source (arcpy)

摘要

提供有关网络数据集中转弯源的信息。

属性

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

The name of the feature class associated with this network source.

String
sourceID
(只读)

The unique identifier of this network source within the network dataset.

Integer
sourceType
(只读)

The type of network source. This property returns the following keywords:

  • EdgeFeature
  • JunctionFeature
  • SystemJunction
  • TurnFeature
  • NetworkSource

String
elementType
(只读)

Network element type of the network source. This property returns the following keywords:

  • Edge
  • Junction
  • Turn

String

代码实例

转弯源属性示例

显示网络数据集中转弯源的信息。

# Name: NDSTurnSourceProperties_ex01.py
# Description: Print the information about the turn sources defined for the 
#              network dataset

import arcpy
import sys

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

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

justify = 35
print ("------- Turn sources") 

#Get all the turn sources for the network dataset
turns = desc.turnSources

#Not all network datasets can have turn sources.
if not turns:
    print ("%*s" % (justify, "(No turn sources)")) 
    sys.exit(0)

for turnSource in turns: 
    print ("%*s: %s" % (justify, "Source Name" , turnSource.name)) 
    print ("%*s: %s" % (justify, "Source ID" , str(turnSource.sourceID))) 
    print ("%*s: %s" % (justify, "Source Type", turnSource.sourceType))
    print ("%*s: %s" % (justify, "Element Type", turnSource.elementType))
    print (" ")
5/10/2014