Краткая информация
Объект Описание щитов набора сетевых данных предоставляет дополнительную информацию о щитах, которая используется для улучшения информации в путевом листе, когда улицы имеют несколько названий.
Обсуждение
Свойства shieldTypeX и shieldDescriptionX являются динамическими. Это означает, что общее количество свойств, поддерживаемых объектом описания щитов, зависит от свойства descriptionCount . Например, если значение свойства descriptionCount равно 2, то объект описания щитов будет поддерживать свойства shieldType0, shieldDescription0, shieldType1 и shieldDescription1.
Свойства
Свойство | Описание | Тип данных |
shieldTypeX (только чтение) | Тип щита для конкретного щита (обозначается X). | Integer |
shieldDescriptionX (только чтение) | Описание щита для конкретного щита (обозначается X). | Integer |
Пример кода
Отображает информацию об описании щитов для каждого источника сети.
# Name: NDSShieldsDescriptionProperties_ex01.py
# Description: Print additional information about directions shields for each
# edge source
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")
#If the directions are not set for the network dataset, exit
if not desc.supportsDirections:
print("No direction information")
sys.exit()
print("Source Direction Information ----")
# Get all the edge sources
sources = desc.edgeSources
if not sources:
print("No edge sources")
sys.exit()
#Loop through all the edge sources
for source in sources:
print("--------------------")
print("Name: " , source.name)
print("Source ID: " , source.sourceID)
#Get the direction information specific to edge source
sDir = source.sourceDirections
#Get the shields for each source
shields = sDir.shields
if shields:
print("----Shields description")
print("Description count: " , shields.descriptionCount)
sDesc = shields.description
if sDesc:
for i in range(0, shields.descriptionCount):
shieldType = getattr(sDesc,"shieldType" + str(i))
sheildDesc = getattr(sDesc, "shieldDescription" + str(i))
print("Type: " , shieldType)
print("Description: " , sheildDesc)
else:
print("(No shield information)")