描述
Registers an existing intersection feature class as an intersection.
使用方法
The projected coordinate system of the intersecting feature classes must match that of the Parent LRS Network parameter value.
The Parent LRS Network parameter value can be used as an intersecting layer, so the intersections produced will be between the routes in a network.
The Parent LRS Network parameter value cannot be a feature service.
The Intersection Feature Class parameter value and the intersecting layers must be in the same geodatabase as the Parent LRS Network parameter value.
The name of the intersection is created by concatenating the Network Description Field parameter value with the Description Field value in the Intersecting Layers parameter, separated by the Name Separator value in the Intersecting Layers parameter.
The Intersection Feature Class fields must include the properties outlined in the LRS data model.
The Intersecting Layers parameter value must be z-enabled.
语法
arcpy.locref.CreateLRSIntersectionFromExistingDataset(parent_network, network_description_field, in_feature_class, intersection_id_field, intersection_name_field, route_id_field, feature_id_field, feature_class_name_field, from_date_field, to_date_field, intersecting_layers, {consider_z}, z_tolerance, measure_field)
参数 | 说明 | 数据类型 |
parent_network | The network to which the intersection will be registered. | Feature Layer |
network_description_field | The field in the network layer that will be used to name the intersections with other intersecting layers. | Field |
in_feature_class | The input point feature class to be registered. | Feature Layer |
intersection_id_field | The ID field in the Intersection Feature Class. The field must have a unique ID for each intersection for a time slice. | Field |
intersection_name_field | The field in the Intersection Feature Class that is a concatenated field showing the descriptors for the route and the intersecting feature. | Field |
route_id_field | The field in the Intersection Feature Class that contains the route ID for the LRS Network. | Field |
feature_id_field | The field in the Intersection Feature Class that contains the ID for the intersecting feature. | Field |
feature_class_name_field | The field in the Intersection Feature Class that contains the name of the feature class that participated in the intersection. | Field |
from_date_field | The from date field in the Intersection Feature Class. | Field |
to_date_field | The to date field in the Intersection Feature Class. | Field |
intersecting_layers [intersecting_layers,...] | The feature class that intersects the LRS Network and contains the following information:
| Value Table |
consider_z (可选) | Specifies whether z-values will be used when generating intersections.
| Boolean |
z_tolerance | The z-tolerance used to generate intersections. | Double |
measure_field | The measure on the base route at the point of intersection. | Field |
派生输出
名称 | 说明 | 数据类型 |
out_feature_class | The output feature class detailing the changes made to the Intersection Feature Class. | Feature Class |
代码示例
The following script demonstrates how to use the CreateLRSIntersectionFromExistingDataset function in the Python window.
# Name: Create_LRS_Intersection_From_Existing_Dataset_ex1.py
# Description: Create an LRS Intersection from an existing dataset.
# Requires: ArcGIS Location Referencing
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# Tool variables
parent_network = r"C:\Demo.gdb\LRS\Network"
network_description_field = "RouteName"
in_feature_class = r"C:\Demo.gdb\LRS\Intersection1"
intersection_id_field = "IntersectionId"
intersection_name_field = "IntersectionName"
route_id_field = "RouteID"
feature_id_field = "featureId"
feature_class_name_field = "featureClassName"
from_date_field = "FromDate"
to_date_field = "ToDate"
intersecting_layers = "[{Network, RouteID, RouteName, & RouteName:}]"
measure_field = "Measure"
# Set current workspace
arcpy.env.workspace = "C:\Demo.gdb"
# Execute the tool
arcpy.locref.CreateLRSIntersectionFromExistingDataset(parent_network, network_description_field, in_feature_class,
intersection_id_field, intersection_name_field, route_id_field,
feature_id_field, feature_class_name_field, from_date_field,
to_date_field, intersecting_layers, measure_field)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
The following script demonstrates how to use the CreateLRSIntersectionFromExistingDataset function in a stand-alone script.
# Name: Create_LRS_Event_From_Existing_Dataset_ex2.py
# Description: Register an existing feature class as an event in this stand-alone script.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# Tool variables
parent_network = r"C:\Demo.gdb\LRS\Network"
network_description_field = "RouteName"
in_feature_class = r"C:\Demo.gdb\LRS\Intersection1"
intersection_id_field = "IntersectionId"
intersection_name_field = "IntersectionName"
route_id_field = "RouteID"
feature_id_field = "featureId"
feature_class_name_field = "featureClassName"
from_date_field = "FromDate"
to_date_field = "ToDate"
intersecting_layers = "[{Network, RouteId, RouteName, & RouteName:}]"
measure_field = "Measure"
# Set current workspace
arcpy.env.workspace = "C:\Demo.gdb"
# Execute the tool
arcpy.locref.CreateLRSIntersectionFromExistingDataset(parent_network, network_description_field, in_feature_class,
intersection_id_field, intersection_name_field, route_id_field,
feature_id_field, feature_class_name_field, from_date_field,
to_date_field, intersecting_layers, measure_field)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
环境
许可信息
- Basic: 需要 ArcGIS Location Referencing
- Standard: 需要 ArcGIS Location Referencing
- Advanced: 需要 ArcGIS Location Referencing