ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Delete Routes

  • 描述
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

Deletes routes and associated data elements from the LRS Network.

使用方法

  • An LRS dataset is required to run this tool.

  • 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.
      警告:

      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.

  • 警告:

    When a network is added in the map, a default definition query displays current time records. Remove this definition query before running the Delete Routes tool.

    Running the Delete Routes tool with this default definition query will result in the deletion of all current and historic routes as well as their elements, such as centerlines, calibration points, and events.

    Delete Routes default definition query
  • 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 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.

  • 警告:

    If the Delete Routes tool is run outside an edit session, the deleted routes cannot be undone.

  • In the case of routes that have a null routeId, the tool will run but records will not be deleted.

  • If conflict prevention is enabled when Delete Routes runs, the selected routes will be locked. If locks cannot be acquired, the tool will not run.

语法

arcpy.locref.DeleteRoutes(in_route_features, {delete_associated_calibration_points}, {delete_associated_events}, {delete_associated_centerlines})
参数说明数据类型
in_route_features

The route feature class registered with the network.

Feature Layer
delete_associated_calibration_points
(可选)

Specifies whether calibration points associated with the deleted routes will be deleted.

  • DELETE_CALIBRATION_POINTS —Calibration points associated with the routes will be deleted.
  • NO_DELETE_CALIBRATION_POINTS —Calibration points associated with the routes will not be deleted. This is the default.
Boolean
delete_associated_events
(可选)

Specifies whether events associated with the deleted routes will be deleted.

  • DELETE_EVENTS —Events associated with the routes will be deleted.
  • NO_DELETE_EVENTS —Events associated with the routes will not be deleted. This is the default.
Boolean
delete_associated_centerlines
(可选)

Specifies whether centerlines that are exclusively associated with the deleted routes will be deleted.

  • DELETE_CENTERLINES —Centerlines exclusively associated with the selected routes will be deleted. If centerlines are shared between networks, those common centerlines will not be deleted.
  • NO_DELETE_CENTERLINES —Centerlines will not be deleted. This is the default.
Boolean

派生输出

名称说明数据类型
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

代码示例

DeleteRoutes example 1 (Python window)

The following Python window script demonstrates how to use the DeleteRoutes function in immediate mode.

# Name: DeleteRoutes.py
# Description: Deletes routes and associated data elements from LRS Network.
# Requires: Roads and Highway license


# tool variables
in_route_features= "StateRoutes"

# set current workspace
arcpy.env.workspace="C:/Data/RH_DOT.gdb"

# execute the tool
arcpy.locref.DeleteRoutes("StateRoutes", "DELETE_CALIBRATION_POINTS", "DELETE_EVENTS", "DELETE_CENTERLINES")
DeleteRoutes example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the DeleteRoutes function.

# Name: DeleteRoutes.py
# Description: Deletes routes and associated data elements from LRS Network.
# Requirements: Roads and Highways license

# Import arcpy module
import arcpy

#Check out the license
arcpy.CheckOutExtension("Highways")

#Provide the path of database
arcpy.env.workspace = r"C:\Users\Desktop\RoadsAndHighwaysData.gdb"

#Convert network feature class to layer
arcpy.MakeFeatureLayer_management("AllRoutes", "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...")

环境

  • 当前工作空间

许可信息

  • Basic: 需要 Roads and Highways
  • Standard: 需要 Roads and Highways
  • Advanced: 需要 Roads and Highways

相关主题

  • An overview of the Location Referencing toolbox

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明