从 LRS 更新测量值 (位置参考)

适用于 Location Referencing 许可。

摘要

用于填充或更新 Utility Network (UN) 要素,例如管道、设备和交汇点,或者非 UN 或 LRS 要素类中的要素上的测量值和路径 ID。

此工具从 LRS 网络参数中找到合适的路径,从该路径获取测量值,并为非 LRS 要素类中的要素填充或更新测量值和路径属性。

注:

使用要素服务中的数据集时,需要 ArcGIS Pipeline Referencing ServerArcGIS Roads and Highways Server 扩展模块才能使用此工具。

使用情况

  • ArcGIS Pro 3.0 开始,此工具支持使用分支版本化的直接连接(客户端和服务器连接)以及以前支持的使用分支版本化通过要素服务的连接。

  • 输入要素LRS 网络参数的字段属性必须匹配。

  • 输入要素LRS 网络参数的空间参考、x,y 分辨率和 x,y 容差必须匹配。

  • 在本地写入文本日志,说明该工具已执行并包含以下内容:

    • 有关未通过验证的任何输入要素的信息
    • 更新前后输入要素的路径 ID 和测量值

  • 输入要素值必须与 LRS 网络要素完全一致。

    以下图表和表格显示了如何从输入要素值更新线要素和点要素,这些输入要素不是 LRS 要素类但与 LRS 网络要素中的 Route1 重合:

    使用线要素更新路径 ID 测量的示例

    输入图层要素类型路径 ID测量始于测量止于评论

    NonLRS 输入图层

    线

    Route1

    11

    18

    线要素的几何与 LRS 网络具有几何匹配。

    使用点要素更新路径 ID 测量的示例

    输入图层要素类型路径 ID测量始于测量止于评论

    NonLRS 输入图层

    Route1

    21

    点要素与 LRS 网络值上的路径重合。

    由于线要素与 LRS 网络不完全重合而无法更新的路径 ID 测量示例

    输入图层要素类型路径 ID测量始于测量止于评论

    NonLRS 输入图层

    线

    线要素的几何与输入网络不重合。 不返回任何信息。

参数

标注说明数据类型
LRS 网络

包含路径、路径 ID 和测量值的要素图层。

Feature Layer
LRS 日期

用于定义网络时间视图以收集路径和测量值的日期。

Date
输入要素

包含路径 ID 和测量字段的图层,这些字段将根据与 LRS 网络参数中的路径相关的要素几何进行更新。

Feature Layer
路径 ID 字段

输入要素图层中包含路径 ID 值的字段。

Field
测量字段

输入要素图层中包含折线要素的测量值的字段。

Field
测量止于字段
(可选)

输入要素图层中包含点要素测量值或折线要素测量值的字段。

Field

派生输出

标注说明数据类型
输出详细信息文件

列出来自输入要素参数的更新要素的输出日志文件。 此日志文件将包含每个更新要素的路径 ID、测量值和测量值的前后值。

Text File
输出要素

更新的要素图层。

注:

此工具的验证结果将写入 ArcGIS Server 目录。 默认情况下,此文件会在 10 分钟内自动清除,这可能不足以处理所有验证并将其写入正在运行 ArcGIS Pro 的工作站。 对于较大的数据负载,建议您将文件最长保留期限调整为至少一小时。

Feature Layer

arcpy.locref.UpdateMeasuresFromLRS(lrs_network, lrs_date, in_features, route_id_field, from_measure_field, {to_measure_field})
名称说明数据类型
lrs_network

包含路径、路径 ID 和测量值的要素图层。

Feature Layer
lrs_date

用于定义网络时间视图以收集路径和测量值的日期。

Date
in_features

包含路径 ID 和测量字段的图层,这些字段将根据与 lrs_network 参数中的路径相关的要素几何进行更新。

Feature Layer
route_id_field

in_features 图层中包含路径 ID 值的字段。

Field
from_measure_field

in_features 图层中包含折线要素的测量值的字段。

Field
to_measure_field
(可选)

in_features 图层中包含点要素测量值或折线要素测量值的字段。

Field

派生输出

名称说明数据类型
out_details_file

列出 in_features 参数更新功能的输出日志文件。 此日志文件将包含每个更新要素的路径 ID、测量值和测量值的前后值。

Text File
out_features

更新的要素图层。

注:

此工具的验证结果将写入 ArcGIS Server 目录。 默认情况下,此文件会在 10 分钟内自动清除,这可能不足以处理所有验证并将其写入正在运行 ArcGIS Pro 的工作站。 对于较大的数据负载,建议您将文件最长保留期限调整为至少一小时。

Feature Layer

代码示例

UpdateMeasuresFromLRS 示例 1(Python 窗口)

此代码示例演示如何在 Python 窗口中使用 UpdateMeasuresFromLRS 函数。

# Name: UpdateMeasuresFromLRS_Sample1.py
# Description: This will populate the Route ID and measures in the input layer based on overlapping routes from the network layer. 
# The output is the input layer with the updated Route ID and measure values, and a .csv file with information on the updated features and errors.
# Requires: ArcGIS Location Referencing

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

## Variables are supported from feature service only. Signing into Portal is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')

# Initialize variables

# Map the lrs network from the feature service. Here, 8 corresponds to the lrs route network.
lrs_network_url =  r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/8"
lrs_network = arcpy.management.MakeFeatureLayer(lrs_network_url, "networkLayer")

# Map the input feature layer from the same feature service. Here, 18 corresponds to the input feature layer.
in_features_url = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/18"
in_features = arcpy.management.MakeFeatureLayer(in_features_url, "inputFeaturesLayer")
lrs_date="10/8/2019"
route_id_field = "ROUTEID"
from_measure_field = "FROMMEASURE"
to_measure_field = "TOMEASURE"

# Execute the tool
arcpy.locref.UpdateMeasuresFromLRS(lrs_network, lrs_date, in_features, route_id_field, from_measure_field, to_measure_field)

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

此代码示例演示如何将 UpdateMeasuresFromLRS 函数用作要素服务中的独立 Python 脚本。

# Name: UpdateMeasuresFromLRS_Sample2.py
# Description: Populate the route ID and measures in the input layer based on overlapping routes from the network layer. 
# The output is the input layer with the updated route ID and measure values, and a .csv file with information on the updated features and errors.
# Requires: ArcGIS Location Referencing
 
# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

## Variables are supported from feature service only. Portal signin is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')

# Initialize variables
# Map the lrs network from the feature service. Here, 8 corresponds to the LRS route network.
lrs_network_url =  r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/8"
lrs_network = arcpy.management.MakeFeatureLayer(lrs_network_url, "networkLayer")

# Map the input feature layer from the same feature service. Here, 18 corresponds to the input feature layer.
in_features_url = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/18"
in_features = arcpy.management.MakeFeatureLayer(in_features_url, "inputFeaturesLayer")
lrs_date="10/8/2019"
route_id_field = "ROUTEID"
from_measure_field = "FROMMEASURE"
to_measure_field = "TOMEASURE"

# Execute the tool
arcpy.locref.UpdateMeasuresFromLRS(lrs_network, lrs_date, in_features, route_id_field, from_measure_field, to_measure_field)

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

环境

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

许可信息

  • Basic: 需要 ArcGIS Location Referencing
  • Standard: 需要 ArcGIS Location Referencing
  • Advanced: 需要 ArcGIS Location Referencing

相关主题