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
(オプション)
|
対象オフセットの計算に使用する方法を指定します。
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
(オプション)
|
出力の形式を指定します。
|
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
# 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
# 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)