Enable Derived Measure Fields (Location Referencing)

摘要

Enables fields to store the derived route ID, derived route name, and derived measure fields for the specified LRS event feature class.

使用情况

  • The fields that will store the derived route ID, derived route name, and derived measure fields need to be available prior to running this tool.

  • You can use an empty event feature class or event feature class that has loaded records.

参数

标注说明数据类型
LRS Event Feature Class

An existing event feature class or feature layer that is registered to an LRS.

Feature Layer
Derived Route ID Field
(可选)

The derived route ID field.

Field
Derived Route Name Field
(可选)

The derived route name field.

Field
Derived (From) Measure Field
(可选)

The derived from measure field.

Field
Derived To Measure Field
(可选)

The derived to measure field.

Field

派生输出

标注说明数据类型
Updated Input Feature Class

The updated feature layer for the event.

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

An existing event feature class or feature layer that is registered to an LRS.

Feature Layer
derived_route_id_field
(可选)

The derived route ID field.

Field
derived_route_name_field
(可选)

The derived route name field.

Field
derived_from_measure_field
(可选)

The derived from measure field.

Field
derived_to_measure_field
(可选)

The derived to measure field.

Field

派生输出

名称说明数据类型
out_feature_class

The updated feature layer for the event.

Feature Layer

代码示例

EnableDerivedMeasureFields example 1 (Python window)

The following Python window script demonstrates how to use the EnableDerivedMeasureFields tool in immediate mode.

# 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.EnableDerivedMeasureFields_locref(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 example 2 (stand-alone script)

The following script demonstrates how to use the EnableDerivedMeasureFields tool in a stand-alone Python script.

# 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.EnableDerivedMeasureFields_locref(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
  • Standard: 需要 ArcGIS Location Referencing
  • Advanced: 需要 ArcGIS Location Referencing

相关主题