Create LRS (Location Referencing)

Summary

Creates an ArcGIS Location Referencing linear referencing system (LRS) and minimum schema items in a specified workspace.

Usage

  • The minimum schema items created are the Centerline, Centerline Sequence, Calibration Point, and Redline feature classes.

  • The names for the LRS, centerline, calibration point, redline, and centerline sequence must be unique and cannot already exist in the geodatabase.

  • The spatial reference, tolerance, and resolution inputs will be applied to all output feature classes.

  • If the input location is a feature dataset, the spatial reference, tolerance, and resolution of the feature dataset must match that of the inputs for the tool.

  • The x,y- and z-tolerance must be at least twice as large as the x,y- and z-resolution.

  • When using an enterprise geodatabase as an input to this tool, the current database user cannot be SDE or DBO.

Parameters

LabelExplanationData Type
Input Location

The file or multipurpose geodatabase where the LRS and minimum schema will be created.

Workspace; Feature Dataset
LRS Name

The name of the output LRS.

String
Centerline Feature Class Name

The name of the output centerline feature class.

String
Calibration Point Feature Class Name

The name of the output calibration point feature class.

String
Redline Feature Class Name

The name of the output redline feature class.

String
Centerline Sequence Table Name

The name of the output centerline sequence table.

String
Spatial Reference

The spatial reference for the output feature classes. When using a Python script, you can use the Well Known ID (WKID) for the spatial reference.

Spatial Reference
XY Tolerance
(Optional)

The x,y-tolerance of the output feature classes.

Linear Unit
Z Tolerance
(Optional)

The z-tolerance of the output feature classes.

Linear Unit
XY Resolution
(Optional)

The x,y-resolution of the output feature classes.

Linear Unit
Z Resolution
(Optional)

The z-resolution of the output feature classes.

Linear Unit

Derived Output

LabelExplanationData Type
Updated Input Location

The updated LRS workspace.

Workspace; Feature Dataset
Output Centerline Feature Class

The updated centerline feature layer.

Feature Class
Output Calibration Point Feature Class

The updated calibration point feature layer.

Feature Class
Output Redline Feature Class

The updated redline feature layer.

Feature Class
Output Centerline Sequence Table

The updated centerline sequence table.

Table

arcpy.locref.CreateLRS(in_workspace, lrs_name, centerline_feature_class_name, calibration_point_feature_class_name, redline_feature_class_name, centerline_sequence_table_name, spatial_reference, {xy_tolerance}, {z_tolerance}, {xy_resolution}, {z_resolution})
NameExplanationData Type
in_workspace

The file or multipurpose geodatabase where the LRS and minimum schema will be created.

Workspace; Feature Dataset
lrs_name

The name of the output LRS.

String
centerline_feature_class_name

The name of the output centerline feature class.

String
calibration_point_feature_class_name

The name of the output calibration point feature class.

String
redline_feature_class_name

The name of the output redline feature class.

String
centerline_sequence_table_name

The name of the output centerline sequence table.

String
spatial_reference

The spatial reference for the output feature classes. When using a Python script, you can use the Well Known ID (WKID) for the spatial reference.

Spatial Reference
xy_tolerance
(Optional)

The x,y-tolerance of the output feature classes.

Linear Unit
z_tolerance
(Optional)

The z-tolerance of the output feature classes.

Linear Unit
xy_resolution
(Optional)

The x,y-resolution of the output feature classes.

Linear Unit
z_resolution
(Optional)

The z-resolution of the output feature classes.

Linear Unit

Derived Output

NameExplanationData Type
out_workspace

The updated LRS workspace.

Workspace; Feature Dataset
out_centerline_feature_class

The updated centerline feature layer.

Feature Class
out_calibration_point_feature_class

The updated calibration point feature layer.

Feature Class
out_redline_feature_class

The updated redline feature layer.

Feature Class
out_centerline_sequence_table

The updated centerline sequence table.

Table

Code sample

CreateLRS example 1 (Python window)

Use the CreateLRS function in immediate mode.

# Name: Create_LRS_ex1.py
# Description: Create an LRS and minimum schema items (Centerline, Centerline Sequence, Calibration Point, Redline).
# Requires: ArcGIS Location Referencing

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

# Tool variables
in_workspace = r"C:/Data/PipelineData.gdb/"
lrs_name = "LRS"
centerline_feature_class_name = "Centerline"
calibration_point_feature_class_name = "Calibration_Point"
redline_feature_class_name = "Redline"
centerline_sequence_table_name = "Centerline_Sequence"
spatial_reference = "26111"
xy_tolerance = "0.01 Meters"
z_tolerance = "0.01 Meters"
xy_resolution = "0.001 Meters"
z_resolution = "0.001 Meters"

# Set current workspace
arcpy.env.workspace = "C:/Data/PipelineData.gdb"

# execute the tool
arcpy.locref.CreateLRS(in_workspace, lrs_name, centerline_feature_class_name, calibration_point_feature_class_name,
                       redline_feature_class_name, centerline_sequence_table_name, spatial_reference, xy_tolerance,
                       z_tolerance, xy_resolution, z_resolution)

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

Use the CreateLRS function as a stand-alone Python script.

# Name: Create_LRS_ex2.py
# Description: Create an LRS and minimum schema items (Centerline, Centerline Sequence, Calibration Point, Redline).
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

# Local Variables
in_workspace = r"C:\Data\PipelineData.gdb"
lrs_name = "LRS"
centerline_feature_class_name = "Centerline"
calibration_point_feature_class_name = "CalibrationPoint"
redline_feature_class_name = "Redline"
centerline_sequence_table_name = "CenterlineSequence"
spatial_reference = "NAD83 Albers Equal Area, 48 States, Panhandle, US Foot"
xy_tolerance = "0.001 Feet"
z_tolerance = "0.001 Feet"
xy_resolution = "0.0001 Feet"
z_resolution = "0.0001 Feet"

arcpy.locref.CreateLRS(in_workspace, lrs_name, centerline_feature_class_name, calibration_point_feature_class_name,
                       redline_feature_class_name, centerline_sequence_table_name, spatial_reference, xy_tolerance,
                       z_tolerance, xy_resolution, z_resolution)

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

Environments

Licensing information

  • Basic: Requires ArcGIS Location Referencing
  • Standard: Requires ArcGIS Location Referencing
  • Advanced: Requires ArcGIS Location Referencing

Related topics