Skip To Content

Create LRS From Existing Dataset

Summary

Creates a linear referencing system (LRS) in the specified workspace using existing datasets.

Usage

  • Minimum schema items are used for the Centerline, Centerline Sequence, Calibration Point, and Redline feature classes; they should be contained within the same geodatabase and should not be used by another LRS in the geodatabase.

  • The spatial reference, tolerance, and resolution of the Centerline, Calibration Points, and Redline feature classes should be the same.

  • The Centerline and Calibration Point feature classes should be z-enabled and not m-enabled.

  • The Redline feature class should not be z- or m-enabled.

Syntax

CreateLRSFromExistingDataset_locref (lrs_name, centerline_feature_class, centerline_centerline_id_field, centerline_sequence_table, centerline_sequence_centerline_id_field, centerline_sequence_route_id_field, centerline_sequence_from_date_field, centerline_sequence_to_date_field, centerline_sequence_network_id_field, calibration_point_feature_class, calibration_point_measure_field, calibration_point_from_date_field, calibration_point_to_date_field, calibration_point_route_id_field, calibration_point_network_id_field, redline_feature_class, redline_from_measure_field, redline_to_measure_field, redline_route_id_field, redline_route_name_field, redline_effective_date_field, redline_activity_type_field, redline_network_id_field)
ParameterExplanationData Type
lrs_name

The name of the LRS being created. The name for the LRS should not already exist in the geodatabase.

String
centerline_feature_class

The feature class to be used as the centerline in the LRS.

Feature Layer
centerline_centerline_id_field

The field containing the centerline ID. GUIDs are supported. The field type should match the centerlineID field type in the Centerline Sequence table.

Field
centerline_sequence_table

The table to be used as the centerline sequence in the LRS.

Table View
centerline_sequence_centerline_id_field

The field containing the centerline ID. GUIDs are supported. The field type should match the centerlineID field type and length in the Centerline feature class.

Field
centerline_sequence_route_id_field

The field containing the route ID. GUID and text field types are supported. The field type should match the routeID field type and length in the Calibration Point and Redline feature classes.

Field
centerline_sequence_from_date_field

A date field containing the from date.

Field
centerline_sequence_to_date_field

A date field containing the to date.

Field
centerline_sequence_network_id_field

The field containing the network ID. Short Integer field type is supported.

Field
calibration_point_feature_class

The feature class to be used as the calibration point in the LRS.

Feature Layer
calibration_point_measure_field

The field containing the measure. Double field type is supported.

Field
calibration_point_from_date_field

A date field containing the from date.

Field
calibration_point_to_date_field

A date field containing the to date.

Field
calibration_point_route_id_field

The field containing the route ID. GUID and text field types are supported. The field type should match the routeID field type and length in the Centerline Sequence table and Redline feature class.

Field
calibration_point_network_id_field

The field containing the network ID. Short Integer field type is supported.

Field
redline_feature_class

The feature class being used as the redline in the LRS.

Feature Layer
redline_from_measure_field

The field containing the from measure. Double field type is supported.

Field
redline_to_measure_field

The field containing the to measure. Double field type is supported.

Field
redline_route_id_field

The field containing the route ID. GUID and text field types are supported. The field type should match the routeID field type and length in the Calibration Point feature class and Centerline Sequence table.

Field
redline_route_name_field

A text field containing the route name.

Field
redline_effective_date_field

A date field containing the effective date.

Field
redline_activity_type_field

The field containing the activity type. Short Integer field type is supported.

Field
redline_network_id_field

The field containing the network ID. Short Integer field type is supported.

Field

Code sample

CreateLRSFromExistingDataset example 1 (Python window)

Demonstrates how to use the CreateLRSFromExistingDataset tool in immediate mode.

# tool variables
lrs_name = "LRS"
centerline_feature_class = "C:/Data/PipelineData.sde/Centerline"
centerline_centerline_id_field = "Centerline_ID"
centerline_sequence_table = "C:/Data/PipelineData.gdb/CenterlineSequence"
centerline_sequence_centerline_id_field = "Centerline_ID"
centerline_sequence_route_id_field = "Route_ID"
centerline_sequence_from_date_field = "From_Date"
centerline_sequence_to_date_field = "To_Date"
centerline_sequence_network_id_field = "Network_ID"
calibration_point_feature_class = "C:/Data/PipelineData.gdb/CalibrationPoint"
calibration_point_measure_field = "Measure"
calibration_point_from_date_field = "From_Date"
calibration_point_to_date_field = "To_Date"
calibration_point_route_id_field = "Route_ID"
calibration_point_network_id_field = "Network_ID"
redline_feature_class = "C:/Data/PipelineData.gdb/Redline"
redline_from_measure_field = "From_Measure"
redline_to_measure_field = "To_Measure"
redline_route_id_field = "Route_ID"
redline_route_name_field = "Route_Name"
redline_effective_date_field = "Effective_Date"
redline_activity_type_field = "Activity_Type"
redline_network_id_field = "Network_ID"

# set current workspace
arcpy.env.workspace = "C:/Data/PipelineData.sde"

# execute the tool
arcpy.CreateLRSFromExistingDataset_locref(lrs_name, centerline_feature_class, centerline_centerline_id_field,
                                          centerline_sequence_table, centerline_sequence_centerline_id_field,
                                          centerline_sequence_route_id_field, centerline_sequence_from_date_field,
                                          centerline_sequence_to_date_field, centerline_sequence_network_id_field,
                                          calibration_point_feature_class, calibration_point_measure_field,
                                          calibration_point_from_date_field, calibration_point_to_date_field,
                                          calibration_point_route_id_field, calibration_point_network_id_field,
                                          redline_feature_class, redline_from_measure_field, redline_to_measure_field,
                                          redline_route_id_field, redline_route_name_field, redline_effective_date_field,
                                          redline_activity_type_field, redline_network_id_field)
CreateLRSFromExistingDataset example 2 (stand-alone script)

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

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

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")

# Local Variables
lrs_name = "LRS"
centerline_feature_class = r"C:\Data\PipelineData.gdb\Centerline"
centerline_centerline_id_field = "CenterlineID"
centerline_sequence_table = r"C:\Data\PipelineData.gdb\CenterlineSequence"
centerline_sequence_centerline_id_field = "CenterlineID"
centerline_sequence_route_id_field = "RouteID"
centerline_sequence_from_date_field = "FromDate"
centerline_sequence_to_date_field = "ToDate"
centerline_sequence_network_id_field = "NetworkID"
calibration_point_feature_class = r"C:\Data\PipelineData.gdb\CalibrationPoint"
calibration_point_measure_field = "Measure"
calibration_point_from_date_field = "FromDate"
calibration_point_to_date_field = "ToDate"
calibration_point_route_id_field = "RouteID"
calibration_point_network_id_field = "NetworkID"
redline_feature_class = r"C:\Data\PipelineData.gdb\Redline"
redline_from_measure_field = "FromMeasure"
redline_to_measure_field = "ToMeasure"
redline_route_id_field = "RouteID"
redline_route_name_field = "RouteName"
redline_effective_date_field = "EffectiveDate"
redline_activity_type_field = "ActivityType"
redline_network_id_field = "NetworkID"

arcpy.CreateLRSFromExistingDataset_locref(lrs_name, centerline_feature_class, centerline_centerline_id_field,
                                          centerline_sequence_table, centerline_sequence_centerline_id_field,
                                          centerline_sequence_route_id_field, centerline_sequence_from_date_field,
                                          centerline_sequence_to_date_field, centerline_sequence_network_id_field,
                                          calibration_point_feature_class, calibration_point_measure_field,
                                          calibration_point_from_date_field, calibration_point_to_date_field,
                                          calibration_point_route_id_field, calibration_point_network_id_field,
                                          redline_feature_class, redline_from_measure_field, redline_to_measure_field,
                                          redline_route_id_field, redline_route_name_field, redline_effective_date_field,
                                          redline_activity_type_field, redline_network_id_field)

Environments

This tool does not use any geoprocessing 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