Mit der Location Referencing-Lizenz verfügbar.
Zusammenfassung
Deletes routes and associated data elements from the LRS Network.
Verwendung
An LRS dataset is required to run this tool. To create an LRS dataset, add the calibration point, centerline, and redline layers to a feature dataset; then run the Modify LRS tool with the geodatabase as the input.
As part of deleting routes, the Delete Routes tool also does the following:
- Delete all Centerline Sequence records that have the routeId of deleted routes.
- Delete all records in the lrs_edit_log table related to deleted routes.
- Optionally delete associated centerlines, calibration points, and events.
Vorsicht:
Running Delete Routes without using Delete associated centerlines, Delete associated calibration points, and Delete associated events may result in those centerlines, calibration points, and events not referencing to any route.
The input must be a network feature class registered with an LRS Network.
Select routes that need to be deleted before running the tool. Selection on an LRS Network feature class can be performed using the Select tool or definition queries.
If no routes have been selected in the LRS Network feature class, the tool will fail.
Selected route records with the same routeId will be deleted across time.
If a route is selected in a Line Network, all routes in the same line are deleted across time.
If the Delete associated calibration points check box is checked, calibration points associated with the routes will be deleted across time.
If the Delete associated events check box is checked, all events registered with the network that have the same routeId of a deleted route will be deleted across time.
If the Delete associated centerlines check box is checked, centerlines associated with the selected routes will be deleted. If centerlines are shared between networks, those common centerlines will not be deleted.
It is recommended that you not run this tool on the default version of a database.
If Delete Routes is run in an edit session, the deleted routes can be undone.
In the case of routes that have a null routeId or lineId, the tool will run but records will not be deleted.
The Delete Routes tool cannot be run on network layers in ArcGIS Pro when a time filter is turned on.
Vorsicht:
If the Delete Routes tool is run outside an edit session, the deleted routes cannot be undone.
Syntax
arcpy.locref.DeleteRoutes(in_route_features, {delete_associated_calibration_points}, {delete_associated_events}, {delete_associated_centerlines})
Parameter | Erklärung | Datentyp |
in_route_features | The route feature class registered with the network. | Feature Layer |
delete_associated_calibration_points (optional) | Specifies whether calibration points associated with the deleted routes will be deleted.
| Boolean |
delete_associated_events (optional) | Specifies whether events associated with the deleted routes will be deleted.
| Boolean |
delete_associated_centerlines (optional) | Specifies whether centerlines that are exclusively associated with the deleted routes will be deleted.
| Boolean |
Abgeleitete Ausgabe
Name | Erklärung | Datentyp |
updated_route_features | Updated LRS Network feature class. | Feature Layer |
out_details_file | A text file that details the routes deleted from the LRS Network feature class. | Text File |
out_derived_route_features | The updated derived route feature layer. | Feature Layer |
Codebeispiel
The following Python window script demonstrates how to use the DeleteRoutes function in immediate mode.
# Name: DeleteRoutes_ex1.py
# Description: Delete routes and associated data elements from LRS Network.
# Requires: ArcGIS Location Referencing
# Check out license
arcpy.checkOutExtension("LocationReferencing")
# Tool variables
in_route_features= "PipelineNetwork"
# Set current workspace
arcpy.env.workspace = "C:\Data\UPDM.gdb"
# Execute the tool
arcpy.locref.DeleteRoutes('PipelineNetwork', 'DELETE_CALIBRATION_POINTS', 'DELETE_EVENTS', 'DELETE_CENTERLINES')
# Check in license
arcpy.CheckInExtension('LocationReferencing')
The following stand-alone script demonstrates how to use the DeleteRoutes function.
# Name: DeleteRoutes_ex2.py
# Description: Delete routes and associated data elements from an LRS Network.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# Provide the path of database
arcpy.env.workspace = r"C:\Users\Desktop\PipelineReferencing.gdb\LRS\LineNetwork"
# Convert network feature class to layer
arcpy.MakeFeatureLayer_management("LineNetwork", "networklyr")
# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management("networklyr", "NEW_SELECTION", "RouteID = '11316262800'")
# Run Delete Routes tool
arcpy.DeleteRoutes_locref("networklyr", "DELETE_CALIBRATION_POINTS", "DELETE_EVENTS", "DELETE_CENTERLINES")
print("Successfully deleted the selected route...")
# Check in license
arcpy.CheckInExtension('LocationReferencing')
The following stand-alone script demonstrates how to use the DeleteRoutes function in a feature service.
# Name: DeleteRoutes_Pro_Ex3.py
# Description: Delete routes in stand-alone mode using a feature service. It is recommended to work in a version and post it into the default version.
# Requires: ArcGIS Location Referencing
# Import arcpy module
import arcpy
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# Set tool variables
delete_associated_calibration_points = "DELETE_CALIBRATION_POINTS"
delete_associated_events = "DELETE_EVENTS"
delete_associated_centerlines = "DELETE_CENTERLINES"
# Input LRS route network is in a feature service. Sign into portal is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')
## Make a layer of the LRS route network from the feature service for applying selection. Here, 1 corresponds to the LRS route network
in_route_layer = arcpy.MakeFeatureLayer_management("https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1", 'route_layer')
## Process: Select Layer by attribute as required
arcpy.SelectLayerByAttribute_management(in_route_layer, "NEW_SELECTION", "RouteID = 'routeid1'")
# Process : Delete Routes
arcpy.DeleteRoutes_locref( in_route_layer, delete_associated_calibration_points, delete_associated_events, delete_associated_centerlines)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
Umgebungen
Lizenzinformationen
- Basic: Erfordert ArcGIS Location Referencing
- Standard: Erfordert ArcGIS Location Referencing
- Advanced: Erfordert ArcGIS Location Referencing