启用派生的测量字段 (位置参考)

摘要

通过字段存储指定 LRS 事件要素类的派生路径 ID、派生路径名称和派生测量字段。

使用情况

  • 在运行此工具之前,将存储派生路径 ID、派生路径名称和派生测量字段的字段需要处于可用状态。

  • 您可以使用空事件要素类或已加载记录的事件要素类。

参数

标注说明数据类型
LRS 事件要素类

已注册到 LRS 的现有事件要素类或要素图层。

Feature Layer
派生路径 ID 字段
(可选)

派生路径 ID 字段。

Field
派生路径名称字段
(可选)

派生路径名称字段。

Field
派生测量(始于)字段
(可选)

派生测量始于字段。

Field
派生测量止于字段
(可选)

派生测量止于字段。

Field

派生输出

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

事件的更新要素图层。

Feature Layer

arcpy.locref.EnableDerivedMeasureFields(in_feature_class, {derived_route_id_field}, {derived_route_name_field}, {derived_from_measure_field}, {derived_to_measure_field})
名称说明数据类型
in_feature_class

已注册到 LRS 的现有事件要素类或要素图层。

Feature Layer
derived_route_id_field
(可选)

派生路径 ID 字段。

Field
derived_route_name_field
(可选)

派生路径名称字段。

Field
derived_from_measure_field
(可选)

派生测量始于字段。

Field
derived_to_measure_field
(可选)

派生测量止于字段。

Field

派生输出

名称说明数据类型
out_feature_class

事件的更新要素图层。

Feature Layer

代码示例

EnableDerivedMeasureFields 示例 1(Python 窗口)

以下 Python 窗口脚本演示了如何在即时模式下使用 EnableDerivedMeasureFields 工具。

# Name: EnableDerivedMeasureFields_ex1.py
# Description: Enables fields to store the derived network route id, route name and measure fields.
# Requires: ArcGIS Location Referencing

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# tool variables 
in_feature_class = "c:\\APR.gdb\\LRS\LineEventFeatureClass"
Derived_route_id_field = "DerivedRouteId"
Derived_route_name_field = "DerivedRouteName"
Derived_from_Measure_field = "DerivedFromMeasure"
Derived_to_Measure_field = "DerivedToMeasure"

# Set current workspace
arcpy.env.workspace = "c:\\EnableDerivedMeasureFields\\Py\\APR.gdb\\LRS\\LineEventFeatureClass"

# Execute the tool
arcpy.locref.EnableDerivedMeasureFields(in_feature_class, Derived_route_id_field, Derived_route_name_field, Derived_from_Measure_field, Derived_to_Measure_field)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
EnableDerivedMeasureFields 示例 2(独立脚本)

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

# Name: EnableDerivedMeasureFields_ex2.py
# Description: Enables fields to store the derived network route id, route name and measure fields.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
in_feature_class = r"c:\EnableDerivedMeasureFields\Py\APR.gdb\LRS\LineEventFeatureClass"
Derived_route_id_field = "DerivedRouteId"
Derived_route_name_field = "DerivedRouteName"
Derived_from_Measure_field = "DerivedFromMeasure"
Derived_to_Measure_field = "DerivedToMeasure"

# Execute the tool
arcpy.locref.EnableDerivedMeasureFields(in_feature_class, Derived_route_id_field, Derived_route_name_field, Derived_from_Measure_field, Derived_to_Measure_field)

# Check in license
arcpy.CheckInExtension('LocationReferencing')

环境

此工具不使用任何地理处理环境。

许可信息

  • Basic: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)
  • Standard: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)
  • Advanced: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)

相关主题