Update Measures From LRS (Location Referencing)

适用于 Location Referencing 许可。

摘要

Populates or updates the measures and route ID on Utility Network (UN) features such as pipes, devices, and junctions or on features in other non-UN or non-LRS feature classes.

This tool finds appropriate routes from the LRS Network parameter, gets the measures from that route, and populates or updates the measure and route attributes for the features in the non-LRS feature class.

注:

The ArcGIS Pipeline Referencing Server extension is required to use this tool.

使用情况

  • The input layer and LRS Network parameter layer must be from an LRS-enabled feature service.

  • The field properties of the Input Features and LRS Network parameters must match.

  • The spatial reference, x,y resolution, and x,y tolerance of the Input Features and LRS Network parameters must match.

  • A text log is written locally that states that the tool was executed and contains the following:

    • Information on any input features that failed validation
    • The route ID and measure values for the updated input features from before and after the update

  • The Input Features must be exactly coincident to the LRS Network features.

    The following diagrams and tables demonstrate how line and point features from the non-LRS Input Features that are coincident to Route1 in the LRS Network will be updated:

    Example of updating route ID measures using a line feature

    Input LayerFeature TypeRoute IDFrom MeasureTo MeasureComments

    Non-LRS input layer

    Line

    Route1

    11

    18

    The line feature's geometry has a geometric match with the LRS network.

    Example of updating route ID measures using a point feature

    Input LayerFeature TypeRoute IDFrom MeasureTo MeasureComments

    Non-LRS input layer

    Point

    Route1

    21

    The point feature is coincident with the route on the LRS Network.

    Example of route ID measures that can't be updated because the line feature is not exactly coincident to the LRS network

    Input LayerFeature TypeRoute IDFrom MeasureTo MeasureComments

    Non-LRS input layer

    Line

    The line feature's geometry is not coincident with the input network. No information is returned.

参数

标注说明数据类型
LRS Network

The feature service layer that contains the routes, route IDs, and measures.

Feature Layer
LRS Date

The date used to define the temporal view of the network for collecting the route and measure values.

Date
Input Features

The layer that includes route ID and measure fields that will be updated based on feature geometry relative to routes in the LRS Network parameter.

Feature Layer
Route ID Field

The field in the Input Features layer that contains the route ID value.

Field
Measure Field

The field in the Input Features layer that contains the from measure value for polyline features.

Field
To Measure Field
(可选)

The field in the Input Features layer that contains the measure value for point features or the to measure value for polyline features.

Field

派生输出

标注说明数据类型
Output Details File

The output log file that lists the updated features in the Input Layer. This log file will include the before and after values for the route ID, from measure, and to measure fields for each updated feature.

Text File
Out Features

The updated feature service layer.

注:

此工具的验证结果将写入 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

The feature service layer that contains the routes, route IDs, and measures.

Feature Layer
lrs_date

The date used to define the temporal view of the network for collecting the route and measure values.

Date
in_features

The layer that includes route ID and measure fields that will be updated based on feature geometry relative to routes in the LRS Network parameter.

Feature Layer
route_id_field

The field in the Input Features layer that contains the route ID value.

Field
from_measure_field

The field in the Input Features layer that contains the from measure value for polyline features.

Field
to_measure_field
(可选)

The field in the Input Features layer that contains the measure value for point features or the to measure value for polyline features.

Field

派生输出

名称说明数据类型
out_details_file

The output log file that lists the updated features in the Input Layer. This log file will include the before and after values for the route ID, from measure, and to measure fields for each updated feature.

Text File
out_features

The updated feature service layer.

注:

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

Feature Layer

代码示例

UpdateMeasuresFromLRS example1 (Python window)

This code sample demonstrates how to use the UpdateMeasuresFromLRS function in the Python window.

# 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.MakeFeatureLayer_management(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.MakeFeatureLayer_management(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 example2 (stand-alone script)

This code sample demonstrates how to use the UpdateMeasuresFromLRS function as a stand-alone Python script in a feature service.

# 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.MakeFeatureLayer_management(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.MakeFeatureLayer_management(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

相关主题