Create LRS (Location Referencing)

描述

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

使用方法

  • 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.

语法

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})
参数说明数据类型
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
(可选)

The xy-tolerance of the output feature classes.

Linear Unit
z_tolerance
(可选)

The z-tolerance of the output feature classes.

Linear Unit
xy_resolution
(可选)

The xy-resolution of the output feature classes.

Linear Unit
z_resolution
(可选)

The z-resolution of the output feature classes.

Linear Unit

派生输出

名称说明数据类型
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

Updated centerline sequence table.

Table

代码示例

CreateLRS example 1 (Python window)

Demonstrates how to use the CreateLRS tool 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.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)

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

Demonstrates how to use the CreateLRS tool 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.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)

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

许可信息

  • Basic: 需要 ArcGIS Location Referencing
  • Standard: 需要 ArcGIS Location Referencing
  • Advanced: 需要 ArcGIS Location Referencing

相关主题