Shields

Resumen

The Network Dataset Shields object provides information about the directions shields settings for a given edge source.

Propiedades

PropiedadExplicaciónTipo de datos
typeFieldName
(Sólo lectura)

The field name whose values contain the street type.

String
numberFieldName
(Sólo lectura)

The field name whose values contain the house number.

String
combinedFieldName
(Sólo lectura)

The field name whose values contain the whole address description.

String
descriptionCount
(Sólo lectura)

The number of shields.

Integer
description
(Sólo lectura)

The Shields Description object.

Object

Ejemplo de código

Shields Properties Example

Display the directions shields information for each edge source in the network dataset.

# Name: NDSShieldsProperties_ex01.py
# Description: Print 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
    if hasattr(sDir,"shields"): 
        shields = sDir.shields 
        print "Shield type field: " , shields.typeFieldName
        print "Number field:" , shields.numberFieldName 
        print "Combined field: " , shields.combinedFieldName 
        print "Description count: " , shields.descriptionCount 
    else: 
        print "(No shield information)"  

7/10/2012