按几何更新 (网络分析)

摘要

使用转弯要素的几何更新转弯要素类中的所有边参照。如果对基础边所做的编辑导致根据列出的转弯 ID 再也无法找到参与转弯的边,则此工具会很有用。

用法

语法

UpdateByGeometry_na (in_turn_features)
参数说明数据类型
in_turn_features

要更新的转弯要素类。

Feature Layer

代码示例

UpdateByGeometry 示例 1(Python 窗口)

使用所有参数执行此工具

import arcpy
arcpy.env.workspace = "C:/ArcTutor/Network Analyst/Tutorial/SanFrancisco.gdb"
arcpy.UpdateByGeometry_na("Transportation/RestrictedTurns")
UpdateByGeometry 示例 2(独立 Python 脚本)

以下 Python 脚本演示了如何在独立脚本中使用 UpdateByGeometry 工具。

# 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


#Check out the Network Analyst extension license
arcpy.CheckOutExtension("Network")

#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."

环境

相关主题


7/10/2012