Create LRS From Existing Dataset (Location Referencing)

描述

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

使用方法

  • Minimum schema items are used for the centerline, centerline sequence, calibration point, and redline feature classes. They should be contained in the same geodatabase, should not be used by another LRS in the geodatabase, and should be empty.

  • Centerline, calibration point, and redline feature classes must reside in a feature dataset.

  • 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 can be m-enabled.

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

语法

arcpy.locref.CreateLRSFromExistingDataset(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)
参数说明数据类型
lrs_name

The name of the LRS to create. The name for the LRS cannot 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 GUID field containing the centerline ID. The field type must 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 GUID field containing the centerline sequence ID. The field type must match the centerlineID field type and length in the centerline feature class.

Field
centerline_sequence_route_id_field

The GUID or text field containing the centerline sequence route ID. The field type must 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 centerline sequence from date.

Field
centerline_sequence_to_date_field

A date field containing the centerline sequence to date.

Field
centerline_sequence_network_id_field

The field containing the centerline sequence network ID. The 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 calibration point measure. The double field type is supported.

Field
calibration_point_from_date_field

A date field containing the calibration point from date.

Field
calibration_point_to_date_field

A date field containing the calibration point to date.

Field
calibration_point_route_id_field

The field containing the calibration point route ID. GUID and text field types are supported. The field type must 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 calibration point network ID. The short integer field type is supported.

Field
redline_feature_class

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

Feature Layer
redline_from_measure_field

The field containing the redline from measure. The double field type is supported.

Field
redline_to_measure_field

The field containing the redline to measure. The double field type is supported.

Field
redline_route_id_field

The field containing the redline route ID. GUID and text field types are supported. The field type must 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 redline route name.

Field
redline_effective_date_field

A date field containing the redline effective date.

Field
redline_activity_type_field

The field containing the redline activity type. The short integer field type is supported.

Field
redline_network_id_field

The field containing the redline network ID. The short integer field type is supported.

Field

派生输出

名称说明数据类型
out_path

The path of the newly created LRS Network.

Workspace

代码示例

CreateLRSFromExistingDataset example 1 (Python window)

This script creates an LRS with existing minimum schema items using the CreateLRSFromExistingDataset function in the Python window.

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

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

# Tool variables
lrs_name = "LRS"
centerline_feature_class = r"C:\Data\PipelineData.sde\LRS\Centerline"
centerline_centerline_id_field = "Centerline_ID"
centerline_sequence_table = r"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 = r"C:\Data\PipelineData.gdb\LRS\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 = r"C:\Data\PipelineData.gdb\LRS\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)

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

This script creates an LRS with existing minimum schema items using the CreateLRSFromExistingDataset function in a stand-alone Python script.

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

# Import arcpy module
import arcpy

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

# Local variables
lrs_name = "LRS"
centerline_feature_class = r"C:\Data\PipelineData.gdb\LRS\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:\DataPipelineData.gdb\LRS\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:\DataPipelineData.gdb\LRS\CalibrationPoint"
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"

# 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)

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

许可信息

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

相关主题