Network Directions Attribute Mapping


The Network Directions Attribute Mapping object provides information about the descriptor attributes in your network dataset that are mapped to specific properties in the network dataset's directions configuration.


PropiedadExplicaciónTipo de datos
(Sólo lectura)

The name of the network attribute mapped to the directions property described by the key property.

(Sólo lectura)

The name of the network dataset directions property to which the network dataset's attribute is being mapped.


Muestra de código

Network Directions Attribute Mapping Properties example

Print the network dataset's directions attribute mapping properties.

# Name:
# Description: Print information about the directions attribute mappings
#              for the network dataset.

import arcpy
import sys

network = r"C:/Data/NetworkDatasetWithDirections.gdb/Transportation/Streets_ND"

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

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

# Get all the network's directions properties
directions = desc.directions

# Loop through the attribute mappings
if hasattr(directions, "attributeMappings"):
    attrMappings = directions.attributeMappings
    for mapping in attrMappings:
        print("\nKey:", mapping.key)
        print("Attribute:", mapping.attribute)
    print("Network dataset does not contain directions attribute mappings.")