arcpy.locref.EnableReferentFields(in_feature_class, {from_referent_method_field}, {from_referent_location_field}, {from_referent_offset_field}, {to_referent_method_field}, {to_referent_location_field}, {to_referent_offset_field}, {offset_units})
|
名称
|
说明
|
数据类型
|
|
in_feature_class
|
将用于 LRS 事件的要素类。
|
Feature Layer
|
|
from_referent_method_field
(可选)
|
自参考方法字段。
|
Field
|
|
from_referent_location_field
(可选)
|
自参考位置字段。
|
Field
|
|
from_referent_offset_field
(可选)
|
自参考偏移字段。
|
Field
|
|
to_referent_method_field
(可选)
|
至参考方法字段。
|
Field
|
|
to_referent_location_field
(可选)
|
至参考位置字段。
|
Field
|
|
to_referent_offset_field
(可选)
|
至参考偏移字段。
|
Field
|
|
offset_units
(可选)
|
指定将使用的偏移测量单位。
MILES—测量单位为英里。 这是默认设置。
INCHES—测量单位为英寸。
FEET—测量单位为英尺。
YARDS—测量单位为码。
NAUTICAL_MILES—测量单位为海里。
INTFEET—测量单位将为国际英尺。
INTMILES—测量单位将为法定英里。
MILLIMETERS—测量单位为毫米。
CENTIMETERS—测量单位为厘米。
METERS—测量单位将为米。
KILOMETERS—测量单位将为千米。
DECIMETERS—测量单位为分米。
|
String
|
派生输出
|
名称
|
说明
|
数据类型
|
|
out_feature_class
|
更新的事件要素图层。
|
Feature Layer
|
代码示例
EnableReferentFields 示例 1(Python 窗口)
以下 Python 脚本演示了如何在即时模式下使用 EnableReferentFields 函数来启用现有 LRS 事件的参考字段。
# Name: Enable_Referent_Fields_ex1.py
# Description: Enable referent fields for an existing LRS Event that already has referent fields configured.
# Requires: ArcGIS Location Referencing
# Local variables:
inputEventFC = r"C:\EnableReferent\Py\EnableReferent.gdb\LRS\Event_Feature_Class"
fromReferentMethodField = "FromRefMethod"
fromReferentLocationField = "FromRefLocation"
fromReferentOffsetField = "FromRefOffset"
toReferentMethodField = "ToRefMethod"
toReferentLocationField = "ToRefLocation"
toReferentOffsetField = "ToRefOffset"
offsetUnit = "FEET"
# Run the tool
arcpy.locref.EnableReferentFields(inputEventFC, fromReferentMethodField, fromReferentLocationField,
fromReferentOffsetField, toReferentMethodField, toReferentLocationField,
toReferentOffsetField, offsetUnit)
EnableReferentFields 示例 2(独立脚本)
以下独立 Python 脚本演示了如何使用 EnableReferentFields 函数来启用现有 LRS 事件的参考字段。
# Name: Enable_Referent_Fields_ex2.py
# Description: Enables referent fields for an existing LRS Event.
# Requires: ArcGIS Pipeline Referencing
# Import arcpy module
import arcpy
# Local variables
inputEventFC = r"C:\EnableReferent\Py\EnableReferent.gdb\LRS\Event_Feature_Class"
fromReferentMethodField = "FromRefMethod"
fromReferentLocationField = "FromRefLocation"
fromReferentOffsetField = "FromRefOffset"
toReferentMethodField = "ToRefMethod"
toReferentLocationField = "ToRefLocation"
toReferentOffsetField = "ToRefOffset"
offsetUnit = "FEET"
# Run the tool
arcpy.locref.EnableReferentFields(inputEventFC, fromReferentMethodField, fromReferentLocationField,
fromReferentOffsetField, toReferentMethodField, toReferentLocationField,
toReferentOffsetField, offsetUnit)
EnableReferentFields 示例 3(独立脚本)
以下独立 Python 脚本演示了如何使用 EnableReferentFields 函数来修改包含已配置参考字段的现有 LRS 事件的参考字段。
# Name: Enable_Referent_Fields_ex3.py
# Description: Modifies referent fields for an existing LRS Event that already has referent fields configured.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
inputEventFC = r"C:\EnableReferent\Py\EnableReferent.gdb\LRS\Event_Feature_Class"
toReferentMethodField = "ToRefMethod2"
toReferentLocationField = "ToRefLocation2"
toReferentOffsetField = "ToRefOffset2"
# Run the tool
arcpy.locref.EnableReferentFields(inputEventFC, '', '', '', toReferentMethodField, toReferentLocationField, toReferentOffsetField, '')