Remove LRS Entity (Location Referencing)

Summary

Removes a linear referencing system (LRS) entity from an input geodatabase workspace.

Usage

  • This tool performs a cascade delete of LRS entities to prevent any orphaned LRS Networks, LRS events, or LRS intersections. This means that removing an LRS will also unregister all LRS Networks that belong to it, as well as remove all LRS events and LRS intersections that belong to those LRS Networks. Similarly, removing an LRS Network will unregister all LRS events and LRS intersections that belong to that network.

  • The input workspace must contain an ArcGIS Location Referencing LRS.

  • This tool does not delete any feature classes, fields, or data. It updates internal metadata tables that store information about the LRS entities in the input geodatabase workspace.

  • Removing an LRS line network that has an LRS derived network registered will also remove the LRS derived network.

  • Removing an LRS event or LRS intersection will only unregister the selected LRS event or LRS intersection; it will not impact the parent LRS Network.

  • Removing a utility network feature class will only unregister it from the LRS. It does not delete the feature class from the database.

  • A list of the LRS entities that were removed is provided upon the successful completion of this tool.

  • The output of this tool is a modified geodatabase workspace.

Parameters

LabelExplanationData Type
LRS Workspace

The input geodatabase workspace that contains the LRS entity that will be removed.

Workspace
LRS Entity Type

Specifies the type of LRS entity that will be removed from the input geodatabase workspace.

  • LRSAn LRS and its dependent LRS Networks, as well as the LRS events, and LRS intersections registered to those LRS Networks, will be removed.
  • NetworkAn LRS Network and the LRS events and LRS intersections registered to that LRS Network will be removed.
  • EventAn LRS event will be removed.
  • IntersectionAn LRS intersection will be removed.
  • Utility Network Feature ClassA utility network feature class will be removed.
String
LRS Entity Name

The name of the LRS entity that will be removed from the input geodatabase workspace. The underlying feature classes and tables of the LRS entity will not be deleted.

String

Derived Output

LabelExplanationData Type
Updated LRS Workspace

The output geodatabase workspace.

Workspace

arcpy.locref.RemoveLRSEntity(in_workspace, lrs_entity_type, lrs_entity_name)
NameExplanationData Type
in_workspace

The input geodatabase workspace that contains the LRS entity that will be removed.

Workspace
lrs_entity_type

Specifies the type of LRS entity that will be removed from the input geodatabase workspace.

  • LRSAn LRS and its dependent LRS Networks, as well as the LRS events, and LRS intersections registered to those LRS Networks, will be removed.
  • NETWORKAn LRS Network and the LRS events and LRS intersections registered to that LRS Network will be removed.
  • EVENTAn LRS event will be removed.
  • INTERSECTIONAn LRS intersection will be removed.
  • UN_FEATURE_CLASSA utility network feature class will be removed.
String
lrs_entity_name

The name of the LRS entity that will be removed from the input geodatabase workspace. The underlying feature classes and tables of the LRS entity will not be deleted.

String

Derived Output

NameExplanationData Type
out_workspace

The output geodatabase workspace.

Workspace

Code sample

RemoveLRSEntity example 1 (Python window)

The following script demonstrates how to use the RemoveLRSEntity tool in the Python window.

# Name: RemoveLRSEntity_ex2.py
# Description: Unregister an LRS Line Network as well as the dependent LRS Derived Network and all LRS Events.
# Requires: ArcGIS Location Referencing

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Tool variables
in_workspace = r"C:\UPDM_Data\LRS\LRS.gdb"
lrs_entity_type = "NETWORK"
lrs_entity_name = "EngineeringNetwork"

# Set current workspace
arcpy.env.workspace = "C:\UPDM_Data\LRS.gdb"

# Execute the tool
arcpy.locref.RemoveLRSEntity(in_workspace, lrs_entity_type, lrs_entity_name)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
RemoveLRSEntity example 2 (stand-alone script)

The following script demonstrates how to use the RemoveLRSEntity tool in a stand-alone Python script.

# Name: RemoveLRSEntity_ex2.py
# Description: Unregister an LRS entity from a geodatabase workspace.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_GDB = r"C:\UPDM_Data\LRS\LRS.gdb"
Entity_Type = "NETWORK"
Entity_Name = "EngineeringNetwork"

# Execute the tool
arcpy.locref.RemoveLRSEntity(Input_GDB, Entity_Type, Entity_Name)

# Check in license
arcpy.CheckInExtension('LocationReferencing')

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)
  • Standard: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)
  • Advanced: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)

Related topics