Generate Intersections (Location Referencing)

Available with Location Referencing license.

Summary

Generates new intersections and updates existing intersections.

Learn more about generating and updating intersections in Pipeline Referencing or generating and updating intersections in Roads and Highways.

Usage

  • Intersection Layer is a point feature class created by the Create LRS Intersection tool that stores the LRS intersection data. This feature class is updated as the result of running this tool.

  • The Network Layer parameter value is a polyline feature class that stores the LRS Network data. You can select routes from this feature class to update their intersections. Definition filters on the network layer are also considered.

  • The route selection or definition filters are only considered if the Network Layer parameter value is defined.

  • The Start Date parameter is used to update intersections on the routes that have been edited since the defined date.

  • You can enable editor tracking for the network layer. Editor tracking is used to find the added, updated, or edited features. Using editor tracking in conjunction with the Start Date parameter value, you can update only those intersections that have changed since the Start Date value provided by the user. This may result in faster performance.

  • If the Only use routes edited by current user parameter is checked, only routes edited by the current user in the current version, as identified by ArcGIS editor tracking, will have intersections updated. For a dataset in a file geodatabase, the intersections will be updated for routes that are edited by the current Microsoft Windows user. Editor tracking must be enabled for the network feature class to use this functionality.

  • The routes to be processed for updating the intersections are identified based on the route selection, route definition query, date selection, and the Only use routes edited by current user parameter value. If you have provided these values, only the routes that fulfill all four conditions will be processed for updating intersections.

  • Intersections will not be generated at the self-intersecting locations of a route.

  • This 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
Intersection Feature Class

The input LRS intersection feature class or layer.

Feature Layer
Network Layer
(Optional)

The input LRS Network feature class or layer.

Feature Layer
Start Date
(Optional)

Filters routes that have been edited after a certain date so that intersections can be generated.

Date
Only use routes edited by current user
(Optional)

Specifies whether intersections will be generated only for routes edited and locked by the current user.

  • Checked—Intersections will be generated only for routes edited by the current user. This is the default.
  • Unchecked—Intersections will be generated for all edited routes.
Boolean

Derived Output

LabelExplanationData Type
Updated Intersection Feature Class

The updated LRS intersection feature class or layer.

Feature Layer
Output Details File

A text file that details changes made by the tool.

Note:

Validation results for this tool are written to the ArcGIS Server directory. This file is automatically cleaned up in 10 minutes by default, which may not be enough time to process all of the validations and write them to your workstation that is running ArcGIS Pro. For larger data loads, it is recommended that you adjust the maximum file age to at least one hour.

Text File

arcpy.locref.GenerateIntersections(in_intersection_feature_class, {in_network_layer}, {start_date}, {edited_by_current_user})
NameExplanationData Type
in_intersection_feature_class

The input LRS intersection feature class or layer.

Feature Layer
in_network_layer
(Optional)

The input LRS Network feature class or layer.

Feature Layer
start_date
(Optional)

Filters routes that have been edited after a certain date so that intersections can be generated.

Date
edited_by_current_user
(Optional)

Specifies whether intersections will be generated only for routes edited and locked by the current user.

  • CURRENT_USERIntersections will be generated only for routes edited by the current user. This is the default.
  • ALL_USERSIntersections will be generated for all edited routes.
Boolean

Derived Output

NameExplanationData Type
out_intersection_feature_class

The updated LRS intersection feature class or layer.

Feature Layer
out_details_file

A text file that details changes made by the tool.

Note:

Validation results for this tool are written to the ArcGIS Server directory. This file is automatically cleaned up in 10 minutes by default, which may not be enough time to process all of the validations and write them to your workstation that is running ArcGIS Pro. For larger data loads, it is recommended that you adjust the maximum file age to at least one hour.

Text File

Code sample

GenerateIntersections example 1 (Python window)

The following script demonstrates how to use the GenerateIntersections function in the Python window.

# Name: GenerateIntersections_ex1.py
# Description: Generates and updates intersections for intersection features registered with an LRS Network.
# Requires: ArcGIS Location Referencing

# Set current workspace
arcpy.env.workspace = r"C:\Data\Demo.gdb"

# Local variables
in_intersection_feature_class = "LRSI1"
in_network_layer = "NonLineNetwork"
start_date = "5/5/2020"
edited_by_current_user = "CURRENT_USER"

# Execute the tool
arcpy.locref.GenerateIntersections(in_intersection_feature_class, in_network_layer, start_date, edited_by_current_user)
GenerateIntersections example 2 (stand-alone script)

The following script demonstrates how to use the GenerateIntersections function in a stand-alone script.

# Name: GenerateIntersections_ex2.py
# Description: Generates and updates intersections for intersection features registered with an LRS Network.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

# Set current workspace
arcpy.env.workspace = r"C:\Data\Demo.gdb"

# Local variables
in_intersection_feature_class = r'C:\Data\Demo.gdb\LRS\LRSI1'
in_network_layer = r'C:\Data\Demo.gdb\LRS\NonLineNetwork'
start_date = "5/5/2020"
edited_by_current_user = "CURRENT_USER"

# Execute the tool
arcpy.locref.GenerateIntersections(in_intersection_feature_class, in_network_layer, start_date, edited_by_current_user)

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

The following script demonstrates how to use the GenerateIntersections function to add intersections into a feature service.

# Name: GenerateIntersections_Pro_ex3_fs.py
# Description: Generates and updates intersections in an existing feature service.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

# Input LRS route network and intersection feature class are in feature service.  Signing in portal is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')

# Local variables
in_intersection_feature_class = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"
in_network_layer = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/1"
start_date = "5/5/2020"
edited_by_current_user = "CURRENT_USER"

# Execute the tool
arcpy.locref.GenerateIntersections(in_intersection_feature_class, in_network_layer, start_date, edited_by_current_user)

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

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