| 标注 | 说明 | 数据类型 |
输入路径要素 | 用于生成路径日志的路径要素。 | Feature Layer |
生效日期 | 定义网络时态视图的日期。 默认值为当前日期。 | Date |
日志字段 (可选) | 用于展示输出中的事件和相交信息的字段。
| Value Table |
合并重合事件 (可选) | 指定是否将重合线事件合并到输出中。
| Boolean |
位置字段 (可选) | 此字段用于展示路径穿过的面边界的属性。
| Value Table |
引用位置 (可选) | 指定用于计算引用偏移的方法。
| String |
引用要素 (可选) | 要素图层用于计算路径日志条目的偏移。 | Feature Layer |
引用字段 (可选) | 引用字段包含输出中引用要素的属性。 | Field |
偏移单位 (可选) | 指定用于计算引用要素和路径日志条目之间的距离的偏移单位。
| String |
输出格式 (可选) | 指定输出的格式。
| String |
输出文件 (可选) | 输出 .csv 文件将包含路径日志。 | File |
输出表 (可选) | 将包含路径日志的输出地理数据库表。 | Table |
适用于 Location Referencing 许可。
摘要
用于在没有 LRS 数据模板的情况下,创建 LRS 网络中路径的路径日志数据产品。
使用情况
此工具支持来自文件地理数据库、企业级地理数据库(分支版本化连接)或要素服务(根据分支版本化数据发布)的数据。
此工具不会修改输入,并将创建 .csv 文件或地理数据库表作为输出。
生效日期参数用于确定网络的时态视图。 仅使用在该日期处于活动状态的路径计算输出。
日志图层、位置图层和参考图层必须存储在相同的地理数据库或要素服务中,并且与指定的 LRS 网络具有相同的坐标系。
日志图层可能是注册至指定 LRS 网络的 LRS 点事件要素类、LRS 线事件要素类或 LRS 交叉点要素类。 当使用Address Data Management解决方案或公共设施网络配置时,中心线要素类还可以用作日志图层。
该位置图层必须为面要素类。
输出将基于 LRS 网络中选择的要素、日志图层、位置图层以及参考图层的交集而创建。
参考图层必须是 LRS 或注册至指定 LRS 网络的 LRS 点事件要素类。
对于未与位置图层重叠的路径,其输出位置字段中将包含值“未分类”。
可通过创建选择图层并将每个选择图层指定为日志字段或位置字段,而从同一个要素类添加多个日志字段和位置字段。 例如,如果您具有 LRS 线事件要素类,则可创建两个选择图层 - A 类和 B 类 - 并将每个选择图层指定为日志字段。
参数
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 (可选) | 指定是否将重合线事件合并到输出中。
| Boolean |
location_fields [location_fields,...] (可选) | 此字段用于展示路径穿过的面边界的属性。
| Value Table |
referent_location (可选) | 指定用于计算引用偏移的方法。
| String |
referent_features (可选) | 要素图层用于计算路径日志条目的偏移。 | Feature Layer |
referent_field (可选) | 引用字段包含输出中引用要素的属性。 | Field |
offset_units (可选) | 指定用于计算引用要素和路径日志条目之间的距离的偏移单位。
| String |
output_format (可选) | 指定输出的格式。
| String |
out_file (可选) | 输出 .csv 文件将包含路径日志。 | File |
out_table (可选) | 将包含路径日志的输出地理数据库表。 | Table |
代码示例
以下脚本演示了如何在 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 函数。
# 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 函数与要素服务中的数据配合使用。
# 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)