按几何更新 (Network Analyst)

摘要

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

使用情况

  • 该工具将根据来自网络源的转弯要素与边要素之间的重叠,来更新转弯要素类的 Edge#FID 字段值。

  • 更新转弯要素时遇到的错误将记录在被写入到 TEMP 系统变量所定义的目录的错误文件中。错误文件的完整路径名将作为警告消息显示。

参数

标注说明数据类型
输入转弯要素类

要更新的转弯要素类。

Feature Layer

派生输出

标注说明数据类型
更新后的输入转弯要素类

更新后的转弯要素类

要素图层

arcpy.na.UpdateByGeometry(in_turn_features)
名称说明数据类型
in_turn_features

要更新的转弯要素类。

Feature Layer

派生输出

名称说明数据类型
out_turn_features

更新后的转弯要素类

要素图层

代码示例

按几何更新 (UpdateByGeometry) 示例 1(Python 窗口)

使用所有参数执行此工具。

turns = "C:/Data/SanFrancisco.gdb/Transportation/RestrictedTurns"
arcpy.na.UpdateByGeometry(turns)
UpdateByGeometry示例 2(独立脚本)

以下 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

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

环境

特殊情况

许可信息

  • Basic: 是
  • Standard: 是
  • Advanced: 是

相关主题