按几何更新 (Network Analyst)

许可等级:BasicStandardAdvanced

摘要

使用转弯要素的几何更新转弯要素类中的所有边引用。如果对基础边所做的编辑导致根据列出的转弯 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.na.UpdateByGeometry("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.na.UpdateByGeometry(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.na.BuildNetwork(inNetworkDataset)

print "Script completed successfully."

环境

相关主题

许可信息

ArcGIS for Desktop Basic:是
ArcGIS for Desktop Standard:是
ArcGIS for Desktop Advanced:是
9/15/2013