Skip To Content

Create LRS

Summary

Creates a 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 should be unique and not 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 xy- and z-tolerance must be at least twice as large as the xy- and z-resolution.

Syntax

CreateLRS_locref (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})
ParameterExplanationData 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

Name of the output centerline feature class.

String
calibration_point_feature_class_name

Name of the output calibration point feature class.

String
redline_feature_class_name

Name of the output redline feature class.

String
centerline_sequence_table_name

Name of the output centerline sequence table.

String
spatial_reference

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

Spatial Reference
xy_tolerance
(Optional)

The xy-tolerance of the output feature classes.

Linear Unit
z_tolerance

The z-tolerance of the output feature classes.

Linear Unit
xy_resolution
(Optional)

The xy-resolution of the output feature classes.

Linear Unit
z_resolution
(Optional)

The z-resolution of the output feature classes.

Linear Unit

Code sample

CreateLRS example 1 (Python window)

Demonstrates how to use the CreateLRS tool in immediate mode.

# tool variables
in_workspace = "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.CreateLRS_locref(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)
CreateLRS example 2 (stand-alone script)

Demonstrates how to use the CreateLRS tool as a stand-alone Python script.

# Name: CreateLRS.py
# Description: Creates an LRS and minimum schema items (Centerline, Centerline Sequence, Calibration Point, Redline) in an existing file or multiuser geodatabase.
# Requires: ArcGIS Pipeline Referencing

# Import arcpy module
import arcpy

# Check out any necessary licenses
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.CreateLRS_locref(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)

Environments

Licensing information

  • ArcGIS Desktop Basic: Requires ArcGIS Pipeline Referencing
  • ArcGIS Desktop Standard: Requires ArcGIS Pipeline Referencing
  • ArcGIS Desktop Advanced: Requires ArcGIS Pipeline Referencing

Related topics