生成线性参考路径日志 (位置参考)

适用于 Location Referencing 许可。

摘要

用于在没有 LRS 数据模板的情况下,创建 LRS 网络中路径的路径日志数据产品。

使用情况

  • 此工具支持来自文件地理数据库、企业级地理数据库(分支版本化连接)或要素服务(根据分支版本化数据发布)的数据。

  • 此工具不会修改输入,并将创建 .csv 文件或地理数据库表作为输出。

  • 生效日期参数用于确定网络的时态视图。 仅使用在该日期处于活动状态的路径计算输出。

  • 日志图层、位置图层和参考图层必须存储在相同的地理数据库或要素服务中,并且与指定的 LRS 网络具有相同的坐标系。

  • 日志图层可能是注册至指定 LRS 网络的 LRS 点事件要素类、LRS 线事件要素类或 LRS 交叉点要素类。 当使用Address Data Management解决方案公共设施网络配置时,中心线要素类还可以用作日志图层。

  • 该位置图层必须为面要素类。

  • 输出将基于 LRS 网络中选择的要素、日志图层、位置图层以及参考图层的交集而创建。

  • 参考图层必须是 LRS 或注册至指定 LRS 网络的 LRS 点事件要素类。

  • 对于未与位置图层重叠的路径,其输出位置字段中将包含值“未分类”。

  • 可通过创建选择图层并将每个选择图层指定为日志字段或位置字段,而从同一个要素类添加多个日志字段和位置字段。 例如,如果您具有 LRS 线事件要素类,则可创建两个选择图层 - A 类和 B 类 - 并将每个选择图层指定为日志字段。

参数

标注说明数据类型
输入路径要素

用于生成路径日志的路径要素。

Feature Layer
生效日期

定义网络时态视图的日期。

默认值为当前日期。

Date
日志字段
(可选)

用于展示输出中的事件和相交信息的字段。

  • 图层 - 要素图层用作日志图层。
  • 字段 - 参与路径日志的字段。

Value Table
合并重合事件
(可选)

指定是否将重合线事件合并到输出中。

  • 选中 - 日志字段中具有相同值的重合线事件将合并并作为单个事件返回。
  • 未选中 - 日志字段中具有相同值的重合线事件将不合并也不作为单个事件返回。 这是默认设置。
Boolean
位置字段
(可选)

此字段用于展示路径穿过的面边界的属性。

  • 图层 - 用作位置图层的要素图层。
  • 字段 - 此字段包含路径穿过的面边界的属性。
Value Table
引用位置
(可选)

指定用于计算引用偏移的方法。

  • 将不计算引用偏移。 这是默认设置。
  • 最近上游路径日志条目上游最近的引用要素将用于计算引用偏移。 如果不存在上游引用要素,则引用值为空。
  • 最邻近路径日志条目最近的引用要素(上游或下游)将用于计算引用偏移。
String
引用要素
(可选)

要素图层用于计算路径日志条目的偏移。

Feature Layer
引用字段
(可选)

引用字段包含输出中引用要素的属性。

Field
偏移单位
(可选)

指定用于计算引用要素和路径日志条目之间的距离的偏移单位。

  • 英寸(美制测量)将以英寸为单位。
  • 英尺(美制测量)单位将为英尺。
  • 码(美制测量)单位将为码。
  • 英里(美制测量)单位将为英里。
  • 海里(美制测量)单位将为海里。
  • 英尺(国际)单位将为国际英尺。 这是默认设置。
  • 法定英里单位将为法定英里。
  • 毫米单位将为毫米。
  • 厘米单位将为厘米。
  • 单位将为米。
  • 千米单位将为千米。
  • 分米单位将为分米。
String
输出格式
(可选)

指定输出的格式。

  • CSV输出将为 .csv 文件。 这是默认设置。
  • 输出将为地理数据库表。
String
输出文件
(可选)

输出 .csv 文件将包含路径日志。

File
输出表
(可选)

将包含路径日志的输出地理数据库表。

Table

arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, {log_fields}, {merge_coincident_events}, {location_fields}, {referent_location}, {referent_features}, {referent_field}, {offset_units}, {output_format}, {out_file}, {out_table})
名称说明数据类型
in_route_features

用于生成路径日志的路径要素。

Feature Layer
effective_date

定义网络时态视图的日期。

默认值为当前日期。

Date
log_fields
[log_fields,...]
(可选)

用于展示输出中的事件和相交信息的字段。

  • 图层 - 要素图层用作日志图层。
  • 字段 - 参与路径日志的字段。

Value Table
merge_coincident_events
(可选)

指定是否将重合线事件合并到输出中。

  • MERGE日志字段中具有相同值的重合线事件将合并并作为单个事件返回。
  • DO_NOT_MERGE日志字段中具有相同值的重合线事件将不合并也不作为单个事件返回。 这是默认设置。
Boolean
location_fields
[location_fields,...]
(可选)

此字段用于展示路径穿过的面边界的属性。

  • 图层 - 用作位置图层的要素图层。
  • 字段 - 此字段包含路径穿过的面边界的属性。
Value Table
referent_location
(可选)

指定用于计算引用偏移的方法。

  • NONE将不计算引用偏移。 这是默认设置。
  • NEAREST_UPSTREAM路径日志条目上游最近的引用要素将用于计算引用偏移。 如果不存在上游引用要素,则引用值为空。
  • NEAREST路径日志条目最近的引用要素(上游或下游)将用于计算引用偏移。
String
referent_features
(可选)

要素图层用于计算路径日志条目的偏移。

Feature Layer
referent_field
(可选)

引用字段包含输出中引用要素的属性。

Field
offset_units
(可选)

指定用于计算引用要素和路径日志条目之间的距离的偏移单位。

  • INCHES将以英寸为单位。
  • FEET单位将为英尺。
  • YARDS单位将为码。
  • MILES单位将为英里。
  • NAUTICAL_MILES单位将为海里。
  • INTFEET单位将为国际英尺。 这是默认设置。
  • INTMILES单位将为法定英里。
  • MILLIMETERS单位将为毫米。
  • CENTIMETERS单位将为厘米。
  • METERS单位将为米。
  • KILOMETERS单位将为千米。
  • DECIMETERS单位将为分米。
String
output_format
(可选)

指定输出的格式。

  • CSV输出将为 .csv 文件。 这是默认设置。
  • TABLE输出将为地理数据库表。
String
out_file
(可选)

输出 .csv 文件将包含路径日志。

File
out_table
(可选)

将包含路径日志的输出地理数据库表。

Table

代码示例

GenerateLRRouteLog 示例 1 (Python 窗口)

以下脚本演示了如何在 Python 窗口中使用 GenerateLRRouteLog 函数。

# Name: GenerateLRRouteLog_ex1.py 
# Description: Create a route log data product that returns the location and information of signal events,
# functional class events, reference posts, intersections, and county boundaries for routes in an LRS Network
# Requirements: ArcGIS Location Referencing

# Set tool variables 
in_route_features = "CountyLog"
effective_date = "12/31/2024"
log_fields = "Signal SIGNAL_MODE; Functional_Class FUNCTIONAL_CLASS; Intersections IntersectionName"
merge_coincident_events = "DO_NOT_MERGE"
location_fields = "Counties NAME"
referent_location = "NEAREST_UPSTREAM"
referent_features = "Reference_Post"
referent_field = "POST_NAME"
offset_units = "INTFEET"
output_format = "TABLE"
out_file = None
out_table = r"C:\Data\SampleData.gdb\RL1"

# Run the tool 
arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, log_fields, merge_coincident_events,
                                location_fields, referent_location, referent_features, referent_field,
                                offset_units, output_format, out_file, out_table)
GenerateLRRouteLog 示例 2(独立脚本)

以下独立脚本演示了如何使用 GenerateLRRouteLog 函数。

# Name: GenerateLRRouteLog_ex2.py 
# Description: For routes in an LRS Network, create a route log data product that returns the location and information of anomalies, pipes, crossing utility intersections, operating pressure,
# ILI surveys, as well as county and city boundaries
# Requirements: ArcGIS Location Referencing

# Import arcpy module 
import arcpy 
 
# Check out the license 
arcpy.CheckOutExtension("LocationReferencing")

# Set current workspace  
arcpy.env.workspace = r"C:\Data\SampleData.gdb"

# Using the Anomaly point event feature class, create a feature layer that contains active anomalies, to be used as a log layer
arcpy.management.MakeFeatureLayer("Anomaly", "Anomaly_Active", "anomalystatus = 'Active'")

# Using the Pipes line event feature class, create three feature layers, each representing a different pipe material, to be used as log layers
arcpy.management.MakeFeatureLayer("Pipes", "Pipes_CastIron", "MATERIAL = 2") 
arcpy.management.MakeFeatureLayer("Pipes", "Pipes_Copper", "MATERIAL = 4") 
arcpy.management.MakeFeatureLayer("Pipes", "Pipes_Composite", "MATERIAL = 10") 

# Set tool variables 
in_route_features = "Engineering Network"
effective_date = "12/31/2024"
log_fields = "Anomaly_Active anomalytype; Crossing Utility Intersection intersectionname; Pipes_CastIron status; Pipes_Copper status; Pipes_Composite status; Operating Pressure pressurevalue"
merge_coincident_events = "DO_NOT_MERGE"
location_fields = "Counties NAME; Cities CITY_NM"
referent_location = "NEAREST_UPSTREAM"
referent_features = "ILI Survey Readings"
referent_field = "surveytype"
offset_units = "INTFEET"
output_format = "TABLE"
out_file = None
out_table = r"C:\Data\SampleData.gdb\RL2"
 
# Run the tool 
arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, log_fields, merge_coincident_events,
                                location_fields, referent_location, referent_features, referent_field,
                                offset_units, output_format, out_file, out_table)
GenerateLRRouteLog 示例 3(独立脚本)

以下独立脚本演示了如何将 GenerateLRRouteLog 函数与要素服务中的数据配合使用。

# Name: GenerateLRRouteLog_ex3.py 
# Description: Create a route log data product that returns the location and information of crashes, speed limits, pavement conditions,
# centerlines, intersections, and city boundaries for routes in a combined LRS and Address Data Management dataset that is published as a feature service
# Requires: ArcGIS Location Referencing 
 
# Import arcpy module 
import arcpy 
 
# Check out the license 
arcpy.CheckOutExtension("LocationReferencing") 
 
# Data is in a feature service. Signing in to the Enterprise portal is required to access the feature service
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password') 
 
# Map the LRS Network from the feature service. Here, 11 corresponds to the LRS Network's layer ID
in_route_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/11"

# Create the feature layers from the feature service. The feature layers will be used as log layers
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/25", "crash")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/24", "intersections")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/17", "speed_limit")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/14", "pavement_condition")
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/19", "centerline")

# Create a feature layer from the Cities layer of the feature service to be used as the location layer
arcpy.management.MakeFeatureLayer(r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/21", "cities")

# Map the Reference Post layer from the feature service to be used as the input to the referent_features parameter
referent_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/26"

# Set tool variables 
effective_date = "12/31/2024"
log_fields = "crash CrashType; intersections IntersectionName; speed_limit SpeedLimit; pavement_condition Condition; centerline fullname"
merge_coincident_events = "MERGE"
location_fields = "cities name"
referent_location = "NEAREST"
referent_field = "PostName"
offset_units = "INTFEET"
output_format = "CSV"
out_file = r"C:\Data\RL3.csv"
out_table = None
 
# Run the tool 
arcpy.locref.GenerateLRRouteLog(in_route_features, effective_date, log_fields, merge_coincident_events,
                                location_fields, referent_location, referent_features, referent_field,
                                offset_units, output_format, out_file, out_table)
 
# Check in the license 
arcpy.CheckInExtension("LocationReferencing")

许可信息

  • Basic: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)
  • Standard: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)
  • Advanced: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)

相关主题