Set Network Attribute (Trace Network)

Summary

Assigns a network attribute to a feature class to be used during trace operations.

A trace network can include network attribute. A network attribute is a value stored in the network topology derived from attributes on corresponding features in the network. While a network attribute can be associated with only one attribute in a feature class, there is no limit to the number of network attributes a trace network can include. Network attributes are used as weights to control traversability and to model the cost of paths in the network.

Usage

  • Network attributes are used in trace analyses to control how the network can be traversed.

  • A network attribute can be associated with only one attribute in a feature class but can be assigned to multiple feature classes in the network.

  • The network topology must be disabled.

  • This tool can be used in conjunction with the Add Network Attribute tool, which adds a network attribute to the trace network.

  • When working with an enterprise geodatabase, the requirements are as follows:

    • The input trace network must be from a database connection established as the database trace network owner.

    • License:
      The active portal account must be assigned a license with the ArcGIS Advanced Editing user type extension to create, publish, and work with a trace network in an enterprise geodatabase.
    • This tool must be executed when connected to the default version.

    Learn more about assigning network attributes

Parameters

LabelExplanationData Type
Input Trace Network

The trace network that contains the network attribute to set.

Trace Network; Trace Network Layer
Network Attribute

The network attribute to be assigned to the feature class field.

String
Feature Class

The input feature class that contains the field that will be used to set the network attribute.

String
Field

An existing field that will be assigned the network attribute. The field data type must match the data type of the network attribute. For example, if the network attribute is a short integer type, the field must also be a short integer type. Network attributes that do not support null values can only be assigned to fields that do not allow null values.

String

Derived Output

LabelExplanationData Type
Updated Trace Network

The updated trace network.

Trace Network

arcpy.tn.SetNetworkAttribute(in_trace_network, network_attribute, featureclass, field)
NameExplanationData Type
in_trace_network

The trace network that contains the network attribute to set.

Trace Network; Trace Network Layer
network_attribute

The network attribute to be assigned to the feature class field.

String
featureclass

The input feature class that contains the field that will be used to set the network attribute.

String
field

An existing field that will be assigned the network attribute. The field data type must match the data type of the network attribute. For example, if the network attribute is a short integer type, the field must also be a short integer type. Network attributes that do not support null values can only be assigned to fields that do not allow null values.

String

Derived Output

NameExplanationData Type
out_trace_network

The updated trace network.

Trace Network

Code sample

SetNetworkAttribute example (Python window)

Set a network attribute named Friction Factor to use the frictionvalue field in the BlackLines feature class.

import arcpy
arcpy.SetNetworkAttribute_tn("Trace Network", "Friction Factor", 
                             "BlackLines", "frictionvalue")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics