Reverse Line Orders (Location Referencing)

Available with Location Referencing license.

Summary

Reverses the line order for all the routes in a line.

Illustration

Reverse Line Orders tool illustration
This diagram shows the reversed line orders for routes in a line.

Usage

  • Use a line network feature class registered with an LRS Network or a line network feature service as input to the tool.

  • Select at least one route for the line whose line order values must be reversed before running the tool. The tool reverses the line order for all the routes in the line.

  • If only a few routes are selected within a given time range, the line order of all routes that overlap with the selected routes time range will be reversed.

  • After running this tool, route time slices may be created for routes (with different time ranges) where line orders were reversed. Run the Generate Events tool to update the events on the routes that include those line orders.

  • After running this tool, run the Generate Routes tool to update the derived network based on the reversed line order values.

  • The tool supports conflict prevention and will attempt to acquire and transfer locks.

    Learn more about conflict prevention in ArcGIS Pipeline Referencing or conflict prevention in ArcGIS Roads and Highways.

Parameters

LabelExplanationData Type
Input Route Features

The LRS line network for which line order values will be reversed.

Feature Layer

Derived Output

LabelExplanationData Type
Updated Route Features

The updated route features feature layer.

Feature Layer
Output Details File

The file that contains the output details.

Text File
Output Derived Route Features

The output derived route features.

Feature Layer

arcpy.locref.ReverseLineOrders(in_route_features)
NameExplanationData Type
in_route_features

The LRS line network for which line order values will be reversed.

Feature Layer

Derived Output

NameExplanationData Type
updated_route_features

The updated route features feature layer.

Feature Layer
out_details_file

The file that contains the output details.

Text File
out_derived_route_features

The output derived route features.

Feature Layer

Code sample

ReverseLineOrders example 1 (stand-alone script)

This Python stand-alone sample shows the ReverseLineOrders function.

# Name: ReverseLineOrder.py
# Description: Reverses the Line Order for all the routes within a line.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

## Map the input LRS route network from the feature service. Here, 1 corresponds to the input LRS route network.
in_route_features = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"

## Process: Select Layer by attribute as required
arcpy.management.SelectLayerByAttribute(in_route_features, "NEW_SELECTION", "RouteID = 'routeid1'")

# Process : Reverse Line Order.
arcpy.locref.ReverseLineOrder(in_route_features)

# Check in license
arcpy.CheckInExtension('LocationReferencing')
ReverseLineOrders example 2 (Python)

This Python sample shows the ReverseLineOrders function.

# Name: ReverseLineOrders_sample.py
# Description: Reverses the Line Order for all the routes within a line.
# Requires: ArcGIS Location Referencing

# Set current workspace
arcpy.env.workspace = 'C:\Data\PipelineReferencing.gdb'

# Set local variables
in_route_features = r'C:\Data\PipelineReferencing.gdb\LRS\LineNetwork'

# Process: Select Layer by attribute as required
arcpy.management.SelectLayerByAttribute(in_route_features, "NEW_SELECTION", "RouteID = 'routeid1'")

# Call the ReverseLineOrders tool
arcpy.locref.ReverseLineOrders(in_route_features)

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