Populate Alternate ID Fields (Network Analyst)


Creates and populates additional fields on the turn feature classes that reference the edges by alternate IDs. The alternate IDs allow for another set of IDs that can help maintain the integrity of the turn features in case the source edges are being edited.



PopulateAlternateIDFields_na (in_network_dataset, alternate_ID_field_name)
ParameterExplanationData Type

The network dataset whose turn feature classes are to receive alternate ID fields. The fields will be created on all of the turn feature classes added as a turn source to the network dataset.

Network Dataset Layer

The name of the alternate ID field on the edge feature sources of the network dataset. All edge feature sources referenced by turns must have the same name for the alternate ID field.


Code Sample

PopulateAlternateID Fields example 1 (Python window)

Execute the tool using all parameters

import arcpy
arcpy.env.workspace = "C:/ArcTutor/Network Analyst/Tutorial/SanFrancisco.gdb"
PopulateAlternateID Fields example 2 (stand-alone Python script)

The following Python script demonstrates how to use the PopulateAlternateID Fields tool in a stand-alone script.

# Name: PopulateAlternateIDFields_ex02.py
# Description: Create and populate the alternate ID fields for all turn sources
#              in the network dataset.
# Requirements: Network Analyst Extension 
# Author: ESRI

#Import system modules
import arcpy
from arcpy import env

#Check out the Network Analyst extension license

#Set environment settings
env.workspace = "C:/data/SanFrancisco.gdb/Transportation"

#Set local variables
inNetworkDataset = "Streets_ND"
altIDFieldName = "ID"

#Populate alternate IDs on all turn sources in the network dataset

print "Script completed successfully."


Related Topics

Licensing Information

ArcView: Requires Network Analyst
ArcEditor: Requires Network Analyst
ArcInfo: Requires Network Analyst

Published 6/7/2010