| ラベル | 説明 | データ タイプ |
入力ルート フィーチャ | LRS 長さデータ プロダクトの計算に使用されるルート フィーチャ。 | Feature Layer |
発効日 | ネットワークの時間ビューの定義に使用される日付。 デフォルト値は、今日の日付です。 | Date |
長さ単位 | 出力の長さフィールドに使用する計測単位を指定します。
| String |
サマリー フィールド (オプション) | 出力でサマリー行の名前の表示に使用されるレイヤーのフィールド。
| Value Table |
長さフィールド (オプション) | 出力でルートの長さの表示に使用されるレイヤーのフィールド。
| Value Table |
NULL のサマリー行を除外 (オプション) | NULL のサマリー行を出力から除外するかどうかを指定します。
| Boolean |
主要なルートの長さを計算 (オプション) | 注意:このパラメーターのサポートは、今後のリリースで追加される予定です。 | Boolean |
出力形式 (オプション) | 出力の形式を指定します。
| String |
出力ファイル (オプション) | 長さデータ プロダクトが格納される出力 .csv ファイル。 | File |
出力テーブル (オプション) | 長さデータ プロダクトが格納される出力ジオデータベース テーブル。 | Table |
Location Referencing ライセンスで利用可能です。
サマリー
LRS データ テンプレートを使用せずに LRS ネットワーク内のルートの長さデータ プロダクトを作成します。
使用法
このツールは、ファイル ジオデータベース、エンタープライズ ジオデータベース (ブランチ バージョン対応接続)、フィーチャ サービス (ブランチ バージョン対応データから公開) のデータをサポートしています。
このツールでは入力は変更されず、出力として .csv ファイルまたはジオデータベース テーブルが作成されます。
[発効日] パラメーターを使用して、ネットワークの時間ビューを定義します。 この日付にアクティブになっているルートだけが出力の計算に使用されます。
サマリー レイヤーは、ポリゴン フィーチャクラスであるか、指定した LRS ネットワークに登録されている LRS ライン イベント フィーチャクラスであるか、LRS ネットワークである必要があります。
長さレイヤーは LRS ネットワークであるか、指定した LRS ネットワークに登録されている LRS ライン イベント フィーチャクラスである必要があります。
サマリー レイヤーと長さレイヤーは、同じジオデータベースまたはフィーチャ サービスに格納され、指定された LRS ネットワークと同じ座標系である必要があります。
サマリー レイヤーとオーバーラップしていないルートの出力サマリー フィールドには、値として unclassified が設定されます。
複数のサマリー フィールドを追加できます。
出力は、LRS ネットワーク、サマリー レイヤー、長さレイヤーから選択されたフィーチャの交差部分に基づいて作成されます。
複数の選択レイヤーを作成し、各選択レイヤーを長さフィールドとして指定することで、同じフィーチャクラスから複数の長さフィールドを追加できます。 たとえば、LRS ライン イベント フィーチャクラスがある場合、2 つの選択レイヤー (クラス A とクラス C) を作成して、各選択レイヤーを長さフィールドとして指定できます。
パラメーター
arcpy.locref.GenerateLRLengthSummary(in_route_features, effective_date, units, {summary_fields}, {length_fields}, {exclude_null_summary_rows}, {calculate_length_for_dominant_routes}, {output_format}, {out_file}, {out_table})| 名前 | 説明 | データ タイプ |
in_route_features | LRS 長さデータ プロダクトの計算に使用されるルート フィーチャ。 | Feature Layer |
effective_date | ネットワークの時間ビューの定義に使用される日付。 デフォルト値は、今日の日付です。 | Date |
units | 出力の長さフィールドに使用する計測単位を指定します。
| String |
summary_fields [summary_fields,...] (オプション) | 出力でサマリー行の名前の表示に使用されるレイヤーのフィールド。
| Value Table |
length_fields [length_fields,...] (オプション) | 出力でルートの長さの表示に使用されるレイヤーのフィールド。
| Value Table |
exclude_null_summary_rows (オプション) | NULL のサマリー行を出力から除外するかどうかを指定します。
| Boolean |
calculate_length_for_dominant_routes (オプション) | 注意:このパラメーターのサポートは、今後のリリースで追加される予定です。 | Boolean |
output_format (オプション) | 出力の形式を指定します。
| String |
out_file (オプション) | 長さデータ プロダクトが格納される出力 .csv ファイル。 | File |
out_table (オプション) | 長さデータ プロダクトが格納される出力ジオデータベース テーブル。 | Table |
コードのサンプル
次のスタンドアロン スクリプトは、スタンドアロン スクリプトで GenerateLRLengthSummary 関数を使用する方法を示しています。
# Name: GenerateLRLengthSummary_ex1.py
# Description: Create a length data product that provides the length of routes for three class types, summarized by counties with a population of more than 50,000
# Requirements: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")
# Set current workspace
arcpy.env.workspace = r"C:\Data\SampleData.gdb"
# Create a feature layer of counties that have more than 50,000 population, to be used as summary field
arcpy.management.MakeFeatureLayer("counties", "counties_50K", "POPULATION > 50000")
# Create 3 feature layers, each representing a class type, to be used as length fields
arcpy.management.MakeFeatureLayer("Class", "Class_A", "classtype = 1")
arcpy.management.MakeFeatureLayer("Class", "Class_B", "classtype = 2")
arcpy.management.MakeFeatureLayer("Class", "Class_C", "classtype = 3")
# Set tool variables
in_route_features = "Network"
effective_date = "12/31/2024"
units = "METERS"
summary_fields = "counties_50K NAME Counties"
length_fields = "Class_A 'Class A'; Class_B 'Class B'; Class_C 'Class C'"
exclude_null_summary_rows = "EXCLUDE"
calculate_length_for_dominant_routes = None
output_format = "CSV"
out_file = r"C:\Data\LP1.csv"
out_table = None
# Run the tool
arcpy.locref.GenerateLRLengthSummary(in_route_features, effective_date, units, summary_fields, length_fields,
exclude_null_summary_rows, calculate_length_for_dominant_routes,
output_format, out_file, out_table)
# Check in licenses
arcpy.CheckInExtension("LocationReferencing")次のスクリプトは、Python ウィンドウでの GenerateLRLengthSummary 関数の使用方法を示しています。
# Name: GenerateLRLengthSummary_ex2.py
# Description: Create a length data product that provides the length of routes for all class types, summarized by counties
# Requirements: ArcGIS Location Referencing
# Set tool variables
in_route_features = "Network"
effective_date = "12/31/2024"
units = "METERS"
summary_fields = "Counties NAME Counties"
length_fields = "'Class' 'Class'"
exclude_null_summary_rows = "DO_NOT_EXCLUDE"
calculate_length_for_dominant_routes = None
output_format = "CSV"
out_file = r"C:\Data\LP2.csv"
out_table = None
# Run the tool
arcpy.locref.GenerateLRLengthSummary(in_route_features, effective_date, units, summary_fields, length_fields,
exclude_null_summary_rows, calculate_length_for_dominant_routes,
output_format, out_file, out_table)次のスタンドアロン スクリプトは、フィーチャ サービスのデータで GenerateLRLengthSummary 関数を使用する方法を示しています。
# Name: GenerateLRLengthSummary_ex3.py
# Description: Using LRS data in a feature service, create a length data product that provides the length of routes
# for three class types, summarized by counties with a population of more than 50,000
# 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, 1 corresponds to the LRS Network's layer ID
in_route_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"
# Map the Counties layer from the feature service. Here, 39 corresponds to the Counties layer's layer ID
counties = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/39"
# Create a feature layer of counties that have more than 50,000 population, to be used as summary field
arcpy.management.MakeFeatureLayer(counties, "counties_50K", "POPULATION > 50000")
# Map the Class layer from the feature service. Here, 22 corresponds to the Class layer's layer ID
classlayer = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/22"
# Create 3 feature layers, each representing a class type, to be used as length fields
arcpy.management.MakeFeatureLayer(classlayer, "Class_A", "classtype = 1")
arcpy.management.MakeFeatureLayer(classlayer, "Class_B", "classtype = 4")
arcpy.management.MakeFeatureLayer(classlayer, "Class_C", "classtype = 7")
# Set tool variables
effective_date = "12/31/2024"
units = "METERS"
summary_fields = "counties_50K NAME Counties"
length_fields = "Class_A 'Class A'; Class_B 'Class B'; Class_C 'Class C'"
exclude_null_summary_rows = "EXCLUDE"
calculate_length_for_dominant_routes = None
output_format = "CSV"
out_file = r"C:\Data\LP3.csv"
out_table = None
# Run the tool
arcpy.locref.GenerateLRLengthSummary(in_route_features, effective_date, units, summary_fields, length_fields,
exclude_null_summary_rows, calculate_length_for_dominant_routes,
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)