arcpy.locref.ModifyLRSNetwork(in_feature_class, {route_id_field}, {route_name_field}, {from_date_field}, {to_date_field}, {derive_from_line_network}, {line_network_name}, {include_fields_to_support_lines}, {line_id_field}, {line_name_field}, {line_order_field}, {route_id_configuration}, {individual_route_id_fields})
|
名称
|
说明
|
数据类型
|
|
in_feature_class
|
要更改的输入 LRS 网络要素类。
|
Feature Layer
|
|
route_id_field
(可选)
|
输入要素类中将映射为 LRS 网络路径 ID 的字段。 字段类型必须与 Centerline_Sequence 表的 RouteId 字段类型匹配,并且必须是字符串或 GUID 字段类型。
|
Field
|
|
route_name_field
(可选)
|
输入要素类中将映射为 LRS 网络路径名称的字符串字段。
|
Field
|
|
from_date_field
(可选)
|
输入要素类中的日期字段,将映射为 LRS 网络的开始日期。
|
Field
|
|
to_date_field
(可选)
|
输入要素类中的日期字段,将映射为 LRS 网络的结束日期。
|
Field
|
|
derive_from_line_network
(可选)
|
确定是否将当前 LRS 网络配置为 LRS 派生网络。
AS_IS—当前的 LRS 网络派生属性不会更改。 这是默认设置。
DERIVE—输入的 LRS 派生网络将被修改为 LRS 派生网络。 还必须提供 line network name 参数以指定从哪个 LRS 网络派生。
DO_NOT_DERIVE—输入的 LRS 派生网络将不被修改为 LRS 派生网络。
|
String
|
|
line_network_name
(可选)
|
输入 LRS 派生网络将注册到的 LRS 线网络的名称。 该输入 LRS 线网络必须与 LRS 网络要素类位于同一地理数据库工作空间和 LRS 中。 只能在将 derive_from_line_network 参数设置为 DERIVE 时,才能使用此参数。
|
String
|
|
include_fields_to_support_lines
(可选)
|
确定是否将当前 LRS 网络配置为支持线。
AS_IS—当前的 LRS 网络线支持属性不会更改。 这是默认设置。
INCLUDE—将修改输入 LRS 网络以添加对线的支持。 还必须提供线 ID 字段、线名称字段和线顺序字段参数,并且映射到这些参数的有效字段必须存在于 LRS 网络要素类中。
DO_NOT_INCLUDE—将修改输入 LRS 网络以删除对线的支持。
|
String
|
|
line_id_field
(可选)
|
输入要素类中将映射为 LRS 网络线 ID 的字段。 只能在将 include_fields_to_support_lines 参数设置为 INCLUDE 时,才能使用此参数。 字段类型必须与 Centerline_Sequence 表的 RouteId 字段类型匹配,并且必须是 38 个字符的字符串或 GUID 字段类型。
|
Field
|
|
line_name_field
(可选)
|
输入要素类中将映射为 LRS 网络线名称的字符串字段。 只能在将 include_fields_to_support_lines 参数设置为 INCLUDE 时,才能使用此参数。
|
Field
|
|
line_order_field
(可选)
|
输入要素类中将映射为 LRS 网络线顺序的字段。 只能在将 include_fields_to_support_lines 参数设置为 INCLUDE 时,才能使用此参数。 该字段必须是长整型字段类型。
|
Field
|
|
route_id_configuration
(可选)
|
确定 LRS 网络的路径 ID 配置。
AS_IS—当前 LRS 网络路径 ID 配置不会更改。 这是默认设置。
AUTOGENERATED_ROUTE_ID—路径 ID 字段将为自动生成的 GUID 字段,并且可以将路径名称配置为 LRS 字段。
SINGLE_FIELD_ROUTE_ID—仅支持非线网络。
MULTI_FIELD_ROUTE_ID—仅支持非线网络。 要形成串联路径 ID,需要多个字段。
|
String
|
|
individual_route_id_fields
[individual_route_id_fields,...]
(可选)
|
in_feature_class 中用于组成路径 ID 的各个字段。 此参数仅在设置 route_id_configuration 参数的 MULTI_FIELD_ROUTE_ID 选项时使用。 字段必须是字符串或整数字段类型。
|
Field
|
派生输出
|
名称
|
说明
|
数据类型
|
|
out_feature_class
|
更新的网络要素图层。
|
Feature Layer
|
代码示例
ModifyLRSNetwork 示例 1(Python 窗口)
演示了如何在 Python 窗口中使用 ModifyLRSNetwork 工具。
# Name: Modify_LRS_Network_ex1.py
# Description: Modifies an existing linear referencing system (LRS) in the specified workspace (Python window)
# Requires: ArcGIS Location Referencing
# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\DerivedNetwork"
route_id_field = "RouteId"
route_name_field = "RouteName"
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = "DO_NOT_DERIVE"
line_network_name = "EngineeringNetwork"
# Set current workspace
arcpy.env.workspace = r"C:\UPDM_Data\LRS.gdb"
# Run the tool
arcpy.locref.ModifyLRSNetwork(in_feature_class, route_id_field, route_name_field, from_date_field, to_date_field,
derive_from_line_network, line_network_name)
ModifyLRSNetwork 示例 2(独立脚本)
演示如何使用 ModifyLRSNetwork 工具作为独立 Python 脚本。
# Name: Modify_LRS_Network_ex2.py
# Description: Modify an LRS Network to change field mapping for date fields. All other parameters will remain as is.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
Input_Network = r"C:\UPDM_Data\LRS.gdb\LRS\EngineeringNetwork"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate_New"
To_Date = "ToDate_New"
Derive = "DO_NOT_DERIVE"
Derive_From = None
Line_Support = "INCLUDE"
Line_ID = "LineId"
Line_Name = "LineName"
Line_Order = "LineOrder"
# Run the tool
arcpy.locref.ModifyLRSNetwork(Input_Network, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From,
Line_Support, Line_ID, Line_Name, Line_Order)
ModifyLRSNetwork 示例 3(Python 窗口)
演示如何在 Python 窗口中使用 ModifyLRSNetwork 工具修改路径 ID 字段以支持用户生成的单字段路径 ID。
# Name: ModifyLRSNetwork example 3 (Python window)
# Description: ModifyLRSNetwork example 3 (Python window)
# Requires: ArcGIS Location Referencing
# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\Network1"
route_id_field = "RouteId"
route_name_field = ""
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = ""
line_network_name = ""
include_fields_to_support_lines =""
line_id_field = ""
line_name_field = ""
line_order_field = ""
route_id_configuration = "SINGLE_FIELD_ROUTE_ID"
individual_route_id_fields = ""
# Set current workspace
arcpy.env.workspace = r"C:\UPDM_Data\LRS.gdb"
# Run the tool
arcpy.locref.ModifyLRSNetwork (in_feature_class, route_id_field, route_name_field, from_date_field, to_date_field, derive_from_line_network, line_network_name, include_fields_to_support_lines, line_id_field, line_name_field, line_order_field, route_id_configuration, individual_route_id_fields)
ModifyLRSNetwork 示例 4(Python 窗口)
演示如何在 Python 窗口中使用 ModifyLRSNetwork 工具修改路径 ID 字段以支持用户生成的多字段路径 ID。
# Name: ModifyLRSNetwork example 4 (Python window)
# Description: ModifyLRSNetwork example 4 (Python window)
# Requires: ArcGIS Location Referencing
# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\Network1"
route_id_field = "RouteId"
route_name_field = ""
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = ""
line_network_name = ""
include_fields_to_support_lines =""
line_id_field = ""
line_name_field = ""
line_order_field = ""
route_id_configuration = "MULTI_FIELD_ROUTE_ID"
individual_route_id_fields = "Field1;Field2;Field3"
# Set current workspace
arcpy.env.workspace = r"C:\UPDM_Data\LRS.gdb"
# Run the tool
arcpy.locref.ModifyLRSNetwork(in_feature_class, route_id_field, route_name_field, from_date_field, to_date_field, derive_from_line_network, line_network_name, include_fields_to_support_lines, line_id_field, line_name_field, line_order_field, route_id_configuration, individual_route_id_fields)
ModifyLRSNetwork 示例 5(独立脚本)
演示如何使用 ModifyLRSNetwork 工具作为独立 Python 脚本来修改路径 ID 字段以支持用户生成的单字段路径 ID。
# Name: ModifyLRSNetwork example 5 (stand-alone script)
# Description: ModifyLRSNetwork example 5 (stand-alone script)
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
Input_Network = r"C:\UPDM_Data\LRS.gdb\LRS\EngineeringNetwork"
Route_ID = "RouteId"
Route_Name = ""
From_Date = "FromDate"
To_Date = "ToDate"
Derive = ""
Derive_From = ""
Line_Support = ""
Line_ID = ""
Line_Name = ""
Line_Order = ""
route_id_configuration = "SINGLE_FIELD_ROUTE_ID"
individual_route_id_fields = ""
# Run the tool
arcpy.locref.ModifyLRSNetwork(Input_Network, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From, Line_Support, Line_ID, Line_Name, Line_Order, route_id_configuration, individual_route_id_fields)
ModifyLRSNetwork 示例 6(独立脚本)
演示如何使用 ModifyLRSNetwork 工具作为独立 Python 脚本来修改路径 ID 字段以支持用户生成的多字段路径 ID。
# Name: ModifyLRSNetwork example 6 (stand-alone script)
# Description: ModifyLRSNetwork example 6 (stand-alone script)
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
Input_Network = r"C:\UPDM_Data\LRS.gdb\LRS\EngineeringNetwork"
Route_ID = "RouteId"
Route_Name = ""
From_Date = "FromDate"
To_Date = "ToDate"
Derive = ""
Derive_From = ""
Line_Support = ""
Line_ID = ""
Line_Name = ""
Line_Order = ""
route_id_configuration = "MULTI_FIELD_ROUTE_ID"
individual_route_id_fields = "Field1;Field2;Field3"
# Run the tool
arcpy.locref.ModifyLRSNetwork(Input_Network, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From, Line_Support, Line_ID, Line_Name, Line_Order, route_id_configuration, individual_route_id_fields)