Network Attributes

Summary

Provides information about network attributes that are defined for a given network dataset.

Discussion

For a given network attribute, edgeDirectionX, sourceNameX, evaluatorTypeX, and dataX are dynamic properties where X indicates a particular evaluator. The possible range of values for X depends on the evaluatorCount property. For example, if a network attribute named DriveTime has two evaluators as indicated by the evaluatorCount property, the DriveTime attribute will support edgeDirection0, sourceName0, evaluatorType0, data0, edgeDirection1, sourceName1, evaluatorType1, and data1 properties.

Similarly, for a given network attribute, parameterNameX, parameterTypeX, and parameterDefaultValueX are dynamic properties where X indicates a particular parameter. The possible range of values for X depends on the parameterCount property. For example, if a network attribute named DriveTime has two parameters as indicated by the parameterCount property, the DriveTime attribute will support parameterName0, parameterType0, parameterDefaultValue0, parameterName1, parameterType1,and parameterDefaultValue1 properties.

Properties

PropertyExplanationData Type
dataType
(Read Only)

The network attribute data type.

  • Boolean—The data type is Boolean.
  • Integer—The data type is integer.
  • Float—The data type is float.
  • Double—The data type is double.

String
dataX
(Read Only)

The value of the network attribute assigned to a network source using the evaluator. In the case of a script evaluator, the entire expression is returned. The data type of the returned value depends on the data type and the evaluator type associated with the network attribute. dataX is a dynamic property. This property is not supported with SDC-based network datasets.

Variant
defaultEdgeData
(Read Only)

The value for the network attribute that is associated by default with all the edge network sources in the network dataset. In the case of a script evaluator, the entire expression is returned. The data type of the returned value depends on the data type and the default edge evaluator type associated with the network attribute.

Variant
defaultEdgeEvaluatorType
(Read Only)

The default edge evaluator type used by the network dataset.

  • Constant—The evaluator type is constant.
  • Script—The evaluator type is script.
  • Function—The evaluator type is function.

String
defaultJunctionData
(Read Only)

The value for the network attribute that is associated by default with all the junction network sources in the network dataset. In case of a script evaluator, the entire expression is returned. The data type of the returned value depends on the data type and the default junction evaluator type associated with the network attribute.

Variant
defaultJunctionEvaluatorType
(Read Only)

The default junction evaluator type used by the network dataset.

  • Constant—The evaluator type is constant.
  • Script—The evaluator type is script.
  • Function—The evaluator type is function.

String
defaultTurnData
(Read Only)

The value for the network attribute that is associated by default with all the turn network sources in the network dataset. In the case of a script evaluator, the entire expression is returned. The property is available only if the network dataset supports turns that can be determined using the supportsTurns property. The data type of the returned value depends on the data type and the default turn evaluator type associated with the network attribute.

Variant
defaultTurnEvaluatorType
(Read Only)

The network dataset default turn evaluator type. The property is available only if the network dataset supports turns that can be determined using the supportsTurns property.

  • Constant—The evaluator type is constant.
  • Script—The evaluator type is script.
  • Global Turn Delay—The evaluator type is global turn delay.
  • Function—The evaluator type is function.

String
directions
(Read Only)

A Network Directions Describe object that provides information about the network's directions configuration. If the network dataset does not support directions, this property will raise an exception.

Object
edgeDirectionX
(Read Only)

The direction for the edge network sources along which the evaluator assigns the value for the network attribute. There is no direction associated with junction and turn network sources. edgeDirectionX is a dynamic property.

  • AlongDigitizedDirection—The direction is along the digitized direction.
  • AgainstDigitizedDirection—The direction is against the digitized direction.
  • None—There is no direction specified.
String
evaluatorCount
(Read Only)

The total number of evaluators used to derive values from the given network source for this network attribute.

Integer
evaluatorTypeX
(Read Only)

The type of evaluator. evaluatorTypeX is a dynamic property.

  • Field—The evaluator type is field.
  • Constant—The evaluator type is constant.
  • Script—The evaluator type is script.
  • Function—The evaluator type is function.
  • NetworkEdgeTraffic—The evaluator type is historical or live traffic data.
  • Public Transit—The evaluator type is public transit data.
  • Not Supported—An evaluator type is unsupported.
String
name
(Read Only)

The name of the network attribute.

String
parameterCount
(Read Only)

The total number of attribute parameters defined for the network attribute.

Integer
parameterDefaultValueX
(Read Only)

The default value for the parameter.

parameterDefaultValueX is a dynamic property that is supported only if the parameterCount value is greater than 0. The data type of the returned value depends on the data type of the attribute parameter.

Variant
parameterNameX
(Read Only)

The name of the parameter.

parameterNameX is a dynamic property that is supported only if the parameterCount value is greater than 0.

String
parameterTypeX
(Read Only)

The data type for the parameter.

parameterTypeX is a dynamic property that is supported only if the parameterCount value is greater than 0.

  • String—The data type is string.
  • Short—The data type is short integer.
  • Integer—The data type is long integer.
  • Float—The data type is float.
  • Double—The data type is double.
  • Date—The data type is date.
  • Boolean—The data type is Boolean.
  • Object—The data type is object.
  • String[]—The data type is a list of strings.
  • Short[]—The data type is a list of short integers.
  • Integer[]—The data type is a list of long integers.
  • Float[]—The data type is a list of floats.
  • Double[]—The data type is a list of doubles.
  • Date[]—The data type is a list of dates.
  • Boolean[]—The data type is a list of Booleans.

String
parameterUsageTypeX
(Read Only)

The usage type for the parameter.

  • General—The usage type is a generic parameter.
  • Restriction—The usage type is a restriction usage parameter.

parameterUsageTypeX is a dynamic property that is supported only if the parameterCount value is greater than 0.

String
sourceNameX
(Read Only)

The name of the network source for which the evaluator calculates the value of a given network attribute. sourceNameX is a dynamic property.

String
trafficSupportType
(Read Only)

The type of traffic data currently configured for the network attribute.

  • HISTORICAL—The type of traffic data is historical traffic.
  • HISTORICAL_AND_LIVE—The type of traffic data is both historical and live traffic.
  • LIVE—The type of traffic data is live traffic.
  • NONE—The type of traffic data is no traffic.

String
units
(Read Only)

The units for the network attribute. Units of a cost attribute are either distance or time units, for example, centimeters, meters, miles, minutes, or seconds. Descriptors, hierarchies, and restrictions have unknown units.

String
usageType
(Read Only)

The network attribute usage type.

  • Cost—The network attribute usage type is cost attribute.
  • Restriction—The network attribute usage type is restriction attribute.
  • Descriptor—The network attribute usage type is descriptor attribute.
  • Hierarchy—The network attribute usage type is hierarchy attribute.

String
useByDefault
(Read Only)

Indicates if the network attribute is used by default on a newly created network analysis layer.

Only one cost attribute in the network dataset can be set to be used by default. Descriptor attributes cannot be used by default.

Boolean

Code sample

Network Attribute Properties Example

Display the network attribute information for a network dataset.

# Name: NDSAttributeProperties_ex01.py
# Description: Print the information about network attributes defined for the
#              network dataset

import arcpy

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

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

# Get a list of network attributes
attributes = desc.attributes
#print information for each attribute
for attribute in attributes:
    print("----------------------------------\n")
    print("Name: ", attribute.name)
    print("Units: ", attribute.units)
    print("Usage Type: ", attribute.usageType)
    print("Data Type: ", attribute.dataType)
    print("Use By Default: ", str(attribute.useByDefault))
    #Information about  default evaluators
    print("Default edge evaluator type: ", attribute.defaultEdgeEvaluatorType)
    print("Default edge evaluator data: ", str(attribute.defaultEdgeData))
    print("Default junction evaluator type: ",attribute.defaultJunctionEvaluatorType)
    print("Default junction evaluator data: ",str(attribute.defaultJunctionData))
    #Turn specific information is supported only if network dataset supports
    #turns
    if desc.supportsTurns:
        print("Default turn evaluator type: ",attribute.defaultTurnEvaluatorType)
        print("Default turn evaluator data: ", str(attribute.defaultTurnData))

    #Describe all other evaluators
    count = attribute.evaluatorCount
    print("Evaluator count: ", count)
    for i in range(0, count):
        text = "Evaluator %d" % i
        print(text, " ---")
        edgeDir = getattr(attribute,"edgeDirection" + str(i))
        print("Edge direction: ", edgeDir)
        srcName = getattr(attribute,"sourceName" + str(i))
        print("Source Name: ", srcName)
        evaluatortype = getattr(attribute,"evaluatorType" + str(i))
        evaluatordata = getattr(attribute,"data" + str(i))
        print("Evaluator Type: ", evaluatortype)
        print("Evaluator Data: ", evaluatordata)

    #Describe attribute parameters
    print("Parameter Information........")
    paramcount = attribute.parameterCount
    if paramcount == 0:
        print("No Parameters defined.")
    else:
        print("Parameter Count: ", paramcount)
    for i in range (0, paramcount):
        paramName = getattr(attribute, "parameterName" + str(i))
        paramType = getattr(attribute, "parameterType" + str(i))
        paramDefaultValue = getattr(attribute, "parameterDefaultValue" + str(i))
        print("Parameter Name: ", paramName)
        print("Parameter Type: ", paramType)
        print("Parameter Default Value: ", paramDefaultValue)