Turn Source

描述

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

属性

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

与该网络源相关的要素类名称。

String
sourceID
(只读)

网络数据集内此网络源的唯一标识符。

Integer
sourceType
(只读)

网络源类型。此属性返回以下关键字:

  • EdgeFeature
  • JunctionFeature
  • SystemJunction
  • TurnFeature
  • NetworkSource

String
elementType
(只读)

网络源的网络元素类型。此属性返回以下关键字:

  • 交汇点
  • 转弯

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(" ")

在本主题中