arcpy.locref.CreateLRSNetworkFromExistingDataset(in_feature_class, lrs_name, 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 网络的输入要素类。 要素类的名称不得超过 26 个字符。 要素类必须位于包含有 LRS 的地理数据库中。 此要素类的名称将用作 LRS 网络的名称。
|
Feature Layer
|
|
lrs_name
|
要注册的新 LRS 网络的 LRS 名称。 该 LRS 必须与 in_feature_class 值位于同一地理数据库中。
|
String
|
|
route_id_field
|
in_feature_class 值中将映射为 LRS 网络路径 ID 的字段。 该字段必须为字符串或 GUID 字段类型。
|
Field
|
|
route_name_field
(可选)
|
in_feature_class 值中将映射为 LRS 网络路径名称的字符串字段。
仅当 route_id_configuration 参数设置为 AUTOGENERATED_ROUTE_ID 时才需要此参数。
|
Field
|
|
from_date_field
|
in_feature_class 值中将映射为 LRS 网络开始日期的日期字段。
|
Field
|
|
to_date_field
|
in_feature_class 值中将映射为 LRS 网络结束日期的日期字段。
|
Field
|
|
derive_from_line_network
(可选)
|
指定是否将网络配置为 LRS 派生网络。
|
Boolean
|
|
line_network_name
(可选)
|
输出 LRS 派生网络将注册到的 LRS 线网络的名称。 该输入 LRS 线网络必须与 in_feature_class 值位于同一地理数据库工作空间中。 此参数仅在 derive_from_line_network 参数值为 DERIVE 时使用。
|
String
|
|
include_fields_to_support_lines
(可选)
|
指定是否将网络配置为支持线。
|
Boolean
|
|
line_id_field
(可选)
|
in_feature_class 值中将映射为 LRS 网络线 ID 的字段。 此参数仅在 include_fields_to_support_lines 参数值为 INCLUDE 时使用。 必须使用字符串或 GUID 字段类型,并且必须与中心线序列表中路径 ID 字段的字段类型和长度相匹配。
|
Field
|
|
line_name_field
(可选)
|
in_feature_class 值中将映射为 LRS 网络线名称的字符串字段。 此参数仅在 include_fields_to_support_lines 参数值为 INCLUDE 时使用。
|
Field
|
|
line_order_field
(可选)
|
in_feature_class 值中将映射为 LRS 网络线顺序的整型字段。 此参数仅在 include_fields_to_support_lines 参数值为 INCLUDE 时使用。
|
Field
|
|
route_id_configuration
(可选)
|
指定将用于 LRS 网络的路径 ID 字段配置。
AUTOGENERATED_ROUTE_ID—路径 ID 字段是一个自动生成的 GUID。 路径名称可以配置为 LRS 字段。 这是默认设置。
SINGLE_FIELD_ROUTE_ID—路径 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
|
代码示例
CreateLRSNetworkFromExistingDataset 示例 1(Python 窗口)
在 Python 窗口中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建 LRS 线网络。
# Name: Create_LRS_Event_From_Existing_Dataset_ex1.py
# Description: Create an LRS Line Network in the Python window.
# Requires: ArcGIS Location Referencing
# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
lrs_name = "LRS"
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 = ""
include_fields_to_support_lines = "INCLUDE"
line_id_field = "LineId"
line_name_field = "LineName"
line_order_field = "LineOrder"
# Set current workspace
arcpy.env.workspace = r"C:\UPDM_Data\LRS.gdb"
# Run the tool
arcpy.locref.CreateLRSNetworkFromExistingDataset(in_feature_class, lrs_name, 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)
CreateLRSNetworkFromExistingDataset 示例 2(独立脚本)
在独立 Python 脚本中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建 LRS 网络。
# Name: CreateLRSNetworkFromExisting_ex2.py
# Description: Create an LRS Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
LRS_Name = "LRS"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
# Run the tool
arcpy.locref.CreateLRSNetworkFromExistingDataset(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date)
CreateLRSNetworkFromExistingDataset 示例 3(独立脚本)
在独立 Python 脚本中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建 LRS 线网络。
# Name: CreateLRS_Line_NetworkFromExisting_ex3.py
# Description: Create an LRS Line Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\EngineeringNetwork"
LRS_Name = "LRS"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
Derive = "DO_NOT_DERIVE"
Derive_From = ""
Line_Support = "INCLUDE"
Line_ID = "LineId"
Line_Name = "LineName"
Line_Order = "LineOrder"
# Run the tool
arcpy.locref.CreateLRSNetworkFromExistingDataset(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive,
Derive_From, Line_Support, Line_ID, Line_Name, Line_Order)
CreateLRSNetworkFromExistingDataset 示例 4(独立脚本)
在独立 Python 脚本中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建 LRS 派生网络。
# Name: CreateLRS_Derived_NetworkFromExisting_ex4.py
# Description: Create an LRS Derived Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\DerivedNetwork"
LRS_Name = "LRS"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
Derive = "DERIVE"
Derive_From = "EngineeringNetwork"
# Run the tool
arcpy.locref.CreateLRSNetworkFromExistingDataset(Input_FC, LRS_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From)
CreateLRSNetworkFromExistingDataset 示例 5(Python 窗口)
在 Python 窗口中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建一个由用户定义的单字段路径 ID。
# Name: CreateLRSNetworkFromExisting_ex5.py
# Description: Create a user-defined, single-field route ID in an LRS Network.
# Requires: ArcGIS Location Referencing
# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
lrs_name = "LRS"
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.CreateLRSNetworkFromExistingDataset(in_feature_class, lrs_name, 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)
CreateLRSNetworkFromExistingDataset 示例 6(Python 窗口)
在 Python 窗口中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建一个由用户定义的多字段路径 ID。
# Name: CreateLRSNetworkFromExisting_ex6.py
# Description: Create a user-defined, single-field route ID in an LRS Network.
# Requires: ArcGIS Location Referencing
# Tool variables
in_feature_class = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
lrs_name = "LRS"
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.CreateLRSNetworkFromExistingDataset(in_feature_class, lrs_name, 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)
CreateLRSNetworkFromExistingDataset 示例 7(独立脚本)
在 Python 窗口中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建一个由用户定义的单字段路径 ID 网络。
# Name: CreateLRSNetworkFromExisting_ex7.py
# Description: Create a user defined, single-field route ID in an LRS Network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing
# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
LRS_Name = "LRS"
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.CreateLRSNetworkFromExistingDataset(Input_FC, LRS_Name, 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)
CreateLRSNetworkFromExistingDataset 示例 8(独立脚本)
在 Python 窗口中使用 CreateLRSNetworkFromExistingDataset 函数以根据现有折线要素类创建一个由用户定义的多字段路径 ID 网络。
# Name: CreateLRSNetworkFromExisting_ex8.py
# Description: Create a user defined, multifield route ID network from an existing polyline feature class.
# Requires: ArcGIS Location Referencing
# Local variables:
Input_FC = r"C:\UPDM_Data\LRS.gdb\LRS\LRSNetwork"
LRS_Name = "LRS"
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.CreateLRSNetworkFromExistingDataset(Input_FC, LRS_Name, 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)