Add Network Attribute (Utility Network)

Summary

Adds a network attribute to a utility network.

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

Usage

  • A network attribute can be associated with only one attribute on a feature class; however, it can be associated with multiple feature classes.

  • When working with an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal utility network owner.

  • The network topology must be disabled.

  • When working with an enterprise geodatabase, this tool must be connected to the default version when executed.

  • When working with an enterprise geodatabase, the Input Utility Network must be from a database connection established as the database utility network owner.

  • This tool can be used with the Set Network Attribute tool, which is used to assign the network attribute to a feature class field in the utility network.

  • The following table lists the network attribute types and their applicable parameters:

    Attribute TypeIn lineApportionableNullableSubstitution

    Short

    Check markCheck mark

    Long

    Check markCheck markCheck mark

    (Out of line only)

    Double

    Check markCheck mark

    Date

    Check mark

Syntax

arcpy.un.AddNetworkAttribute(in_utility_network, attribute_name, attribute_type, {is_inline}, {is_apportionable}, {domain}, {is_overridable}, {is_nullable}, {is_substitution}, {network_attribute_to_substitute})
ParameterExplanationData Type
in_utility_network

The input utility network where the network attribute will be added.

Utility Network; Utility Network Layer
attribute_name

The name of the network attribute to add to the utility network.

String
attribute_type

Specifies the data type of the network attribute.

  • SHORTShort integer type
  • LONGLong integer type
  • DOUBLEDouble precision type
  • DATEDate type
String
is_inline
(Optional)

Specifies whether the network attribute will be persisted in line. In-line network attributes are slightly more efficient, but the number of bits for in-line attributes is limited to 28 per utility network. The most frequently used network attributes (for example, phase for electric networks, pressure for gas and water networks) should be stored in line if possible. The size of the bits is determined by the domain parameter. In-line attributes are only supported for integer network attributes.

  • INLINEThe attribute will be added internally to the topology, making retrieval more efficient.
  • NOT_INLINEThe attribute will be stored in an external table, and retrieval will require a call to the external weights table. This is the default.
Boolean
is_apportionable
(Optional)

Specifies whether the network attribute will be apportioned across multiple edges belonging to the same feature.

For example, with the shape_length network attribute, if one line feature consists of five edge elements, and if the total length of that line feature is 100 feet, that attribute will be apportioned across all edges, with 20 feet for each. The distribution of the value depends on the percentage along each edge element with respect to the from point of the original feature.

  • APPORTIONABLEThe network attribute will be apportioned.
  • NOT_APPORTIONABLEThe network attribute will not be apportioned. This is the default.
Boolean
domain
(Optional)

The domain with which the network attribute is to be associated. This parameter is required when is_inline is True. This domain is used to determine how many bits to allocate for the in-line attribute and must be a coded value type. For example, the LifeCycleStatusDomain (0, Unknown | 1, In-Service | 2, Proposed | 3, Abandoned) domain has four entries, which means 2 bits are required to store the in-line attribute. The coded value domain must have sequential codes starting from 0.

String
is_overridable
(Optional)

Note:

This parameter is not used, and any entered value will be ignored in the current release. The functionality of this parameter is under development and will be applicable in a future release.

Specifies whether a network attribute has an external override table that the network topology read and override (or overwrite) the current value stored in the topology. This can be used to input live data from external systems, such as present position in the case of electric or pressure value in the case of gas. An example is a SCADA system pushing the updated switching positions of Device A to the override table of the DeviceStatus network attribute, which the topology engine then uses to override its current value of device status for Device A with the override value.

  • OVERRIDEThe current value stored in the topology will be overridden.
  • NOT_OVERRIDABLEThe current value stored in the topology will not be overridden. This is the default.
Boolean
is_nullable
(Optional)

Specifies whether the network attribute will support null values.

  • NULLABLEThe network attribute will support null values.
  • NOT_NULLABLEThe network attribute will not support null values. This is the default.
Boolean
is_substitution
(Optional)

Specifies whether the network attribute will be used as a substitution. Substitution network attributes allow a substituted value to be used instead of bitset network attribute values during a propagation in a trace operation.

  • SUBSTITUTIONThe network attribute will be used as a substitution.
  • NOT_SUBSTITUTIONThe network attribute will not be used as a substitution. This is the default.
Boolean
network_attribute_to_substitute
(Optional)

The network attribute to be used for substitution. Substitutions are encoded based on the number of bits in the network attribute being propagated. The network attribute must be in-line and an integer field type less than or equal to 8 bits.

String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network

Code sample

AddNetworkAttribute example 1 (Python window)

Add a network attribute named Device Status with a short attribute type.

import arcpy
arcpy.AddNetworkAttribute_un("Utility Network", "Device Status", "SHORT", 
                             "INLINE", "NOT_APPORTIONABLE", "", 
                             "ElectricDistributionDeviceStatus", 
                             "NOT_OVERRIDABLE")
AddNetworkAttribute example 2 (Python window)

Add a network attribute to be used for substitution.

import arcpy
arcpy.AddNetworkAttribute_un("Utility Network", 
                             "Phases", "LONG", "NOT_INLINE", 
                             "NOT_APPORTIONABLE", 
                             "ElectricDistributionDeviceStatus", "", 
                             "NOT_NULLABLE", "SUBSTITUTION", 
                             "Phases current")

Environments

Licensing information

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

Related topics