Summary
Updates all the edge references in the turn feature class using the geometry of the turn features. This tool is useful when the IDs listed for the turn can no longer find the edges participating in the turn due to edits to the underlying edges.
Usage
The tool updates the Edge#FID field values on the turn feature class based on the coincidence between the turn features and the edge features from the network sources.
Errors encountered when updating the turn features are reported in an error file written to the directory defined by the TEMP system variable. The full path name to the error file is reported as a warning message.
Syntax
arcpy.na.UpdateByGeometry(in_turn_features)
Parameter | Explanation | Data Type |
in_turn_features | The turn feature class to be updated. | Feature Layer |
Derived Output
Name | Explanation | Data Type |
out_turn_features | Updated turn feature class. | Feature Layer |
Code sample
Execute the tool using all parameters.
turns = "C:/Data/SanFrancisco.gdb/Transportation/RestrictedTurns"
arcpy.na.UpdateByGeometry(turns)
The following Python script demonstrates how to use the UpdateByGeometry tool in a stand-alone script.
# Name: UpdateByGeometry_ex02.py
# Description: Update edge references in the turn feature class using the
# geometry of turn features and re-build the network dataset.
# Requirements: Network Analyst Extension
#Import system modules
import arcpy
from arcpy import env
#Set environment settings
env.workspace = "C:/data/SanFrancisco.gdb"
#Set local variables
inTurnFeatures = "RestrictedTurns"
inNetworkDataset = "Transportation/Streets_ND"
#update the edge references in turn features using the geometry
arcpy.UpdateByGeometry_na(inTurnFeatures)
#Since we have modified the edge references for turn sources, we should rebuild
#the network dataset so that the turn features are correctly interpreted by the
#network dataset
arcpy.BuildNetwork_na(inNetworkDataset)
print("Script completed successfully.")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes