Create LRS Network (Location Referencing)

摘要

Creates an LRS Network in an ArcGIS Location Referencing linear referencing system (LRS).

使用情况

  • The input workspace must contain a Location Referencing LRS.

  • If the input workspace contains more than one Location Referencing LRS, a drop-down menu is provided to choose the LRS to which the network will be registered. Any valid LRS in the input workspace can be entered in a Python script.

  • The LRS Network name must be 26 or fewer characters and cannot contain any special characters other than underscores.

  • The x,y resolution, x,y tolerance, and m-tolerance of the output feature class must match the resolution and tolerance settings of the Location Referencing LRS.

  • The unit of measure (m-units) for the output LRS Network can be set to a unit other than that of the spatial reference.

  • The default output of this tool is an LRS Network that does not support lines, along with a feature class that does not contain the necessary fields to support lines. If you want an LRS network that supports lines, check the Include Fields to Support Lines parameter and map the additional fields required for an LRS line network. If you want an LRS derived network, check the Derive From Line Network parameter and provide the LRS line network to which the LRS derived network will be registered.

  • This tool will add information to internal metadata tables to register the output feature class as the LRS Network feature class.

  • A feature class can only be registered as one LRS Network feature class at a time. If a feature class is already registered and that name must be used as the output feature class name, delete the LRS Network to which the feature class is registered.

  • A field in the output feature class can only be mapped to one LRS Network required field.

  • The output of this tool is an LRS Network and an empty polyline feature class that will store the routes of the LRS Network.

  • The output LRS Network and output feature class will have the same name as defined by the LRS Network Name parameter.

参数

标注说明数据类型
Input Location

The input workspace that will contain the new LRS Network. This workspace must be a geodatabase that contains a Location Referencing LRS. In addition to the top level of a geodatabase, a feature dataset is also supported as a valid path.

Workspace; Feature Dataset
LRS Name

The LRS to which the new LRS Network will be registered. The LRS must reside in the same geodatabase as the Input Location.

String
LRS Network Name

The name of the LRS Network that will be created, as well as the name of the feature class that will be created and registered with the LRS Network. The LRS Network name must be 26 or fewer characters and cannot contain special characters other than underscores.

String
Route ID Field

The field in the output feature class that will be mapped as the LRS Network route ID. The field type is derived from the RouteId field of the centerline sequence table and must be either string or GUID.

String
Route Name Field

A string field in the output feature class that will be mapped as the LRS Network route name.

String
From Date Field

A date field in the output feature class that will be mapped as the LRS Network from date.

String
To Date Field

A date field in the output feature class that will be mapped as the LRS Network to date.

String
Derive From Line Network
(可选)

Specifies whether the network will be configured as an LRS derived network.

  • Checked—The output will be an LRS derived network and a feature class to support the LRS derived network. The Line Network Name parameter must also be provided.
  • Unchecked—The output will not be an LRS derived network. This is the default.
Boolean
Line Network Name
(可选)

The name of the LRS line network to which the output LRS derived network will be registered. The input LRS line network must reside in the same geodatabase workspace as the Line Network Name. This parameter is only used if the Derive From Line Network parameter is checked.

String
Include Fields to Support Lines
(可选)

Specifies whether fields that support lines will be added.

  • Checked—The output will be an LRS line network, and the output feature class will include fields that support lines. The Line ID Field, Line Name Field, and Line Order Field parameters must also be provided.
  • Unchecked—The output will not be an LRS line network. This is the default.
Boolean
Line ID Field
(可选)

The field in the output feature class that will be mapped as the LRS Network line ID. This parameter is only used if the Include Fields to Support Lines parameter is checked. The field type is derived from the RouteId field of the centerline sequence table and will either be a string of exactly 38 characters or a GUID field type.

String
Line Name Field
(可选)

A string field in the output feature class that will be mapped as the LRS Network line name. This parameter is only used if the Include Fields to Support Lines parameter is checked.

String
Line Order Field
(可选)

The field in the output feature class that will be mapped as the LRS Network line order. This parameter is only used if the Include Fields to Support Lines parameter is checked. This will be a long integer field type.

String
Measure Unit
(可选)

Specifies the unit of measure (m-unit) the LRS Network will use.

  • Miles—This is the default.
  • Inches
  • Feet
  • Yards
  • Nautical Miles
  • Millimeters
  • Centimeters
  • Meters
  • Kilometers
  • Decimeters

  • MilesThe unit of measure is miles. This is the default.
  • InchesThe unit of measure is inches.
  • FeetThe unit of measure is feet.
  • YardsThe unit of measure is yards.
  • Nautical milesThe unit of measure is nautical miles.
  • MillimetersThe unit of measure is millimeters.
  • CentimetersThe unit of measure is centimeters
  • MetersThe unit of measure is meters.
  • KilometersThe unit of measure is kilometers.
  • DecimetersThe unit of measure is decimeters.
String

派生输出

标注说明数据类型
Output Network Feature Class

The updated network feature class.

Feature Layer

arcpy.locref.CreateLRSNetwork(in_path, lrs_name, network_name, route_id_field, route_name_field, from_date_field, to_date_field, {derive_from_line_network}, {line_network_name}, {include_fields_to_support_lines}, {line_id_field}, {line_name_field}, {line_order_field}, {measure_unit})
名称说明数据类型
in_path

The input workspace that will contain the new LRS Network. This workspace must be a geodatabase that contains a Location Referencing LRS. In addition to the top level of a geodatabase, a feature dataset is also supported as a valid path.

Workspace; Feature Dataset
lrs_name

The LRS to which the new LRS Network will be registered. The LRS must reside in the same geodatabase as the in_path.

String
network_name

The name of the LRS Network that will be created, as well as the name of the feature class that will be created and registered with the LRS Network. The LRS Network name must be 26 or fewer characters and cannot contain special characters other than underscores.

String
route_id_field

The field in the output feature class that will be mapped as the LRS Network route ID. The field type is derived from the RouteId field of the centerline sequence table and must be either string or GUID.

String
route_name_field

A string field in the output feature class that will be mapped as the LRS Network route name.

String
from_date_field

A date field in the output feature class that will be mapped as the LRS Network from date.

String
to_date_field

A date field in the output feature class that will be mapped as the LRS Network to date.

String
derive_from_line_network
(可选)

Specifies whether the network will be configured as an LRS derived network.

  • DERIVEThe output will be an LRS derived network and a feature class to support the LRS derived network. The line_network_name parameter must also be provided.
  • DO_NOT_DERIVEThe output will not be an LRS derived network. This is the default.
Boolean
line_network_name
(可选)

The name of the LRS line network to which the output LRS derived network will be registered. The input LRS line network must reside in the same geodatabase workspace as the line_network_name. This parameter is only used if the derive_from_line_network parameter is set to DERIVE.

String
include_fields_to_support_lines
(可选)

Specifies whether fields that support lines will be added.

  • INCLUDEThe output will be an LRS line network, and the output feature class will include fields that support lines. The line_id_field, line_name_field, and line_order_field parameters must also be provided.
  • DO_NOT_INCLUDEThe output will not be an LRS line network. This is the default.
Boolean
line_id_field
(可选)

The field in the output feature class that will be mapped as the LRS Network line ID. This parameter is only used if the include_fields_to_support_lines parameter is set to INCLUDE. The field type is derived from the RouteId field of the centerline sequence table and will either be a string of exactly 38 characters or a GUID field type.

String
line_name_field
(可选)

A string field in the output feature class that will be mapped as the LRS Network line name. This parameter is only used if the include_fields_to_support_lines parameter is set to INCLUDE.

String
line_order_field
(可选)

The field in the output feature class that will be mapped as the LRS Network line order. This parameter is only used if the include_fields_to_support_lines parameter is set to INCLUDE. This will be a long integer field type.

String
measure_unit
(可选)

Specifies the unit of measure (m-unit) the LRS Network will use.

  • MILESThe unit of measure is miles. This is the default.
  • INCHESThe unit of measure is inches.
  • FEETThe unit of measure is feet.
  • YARDSThe unit of measure is yards.
  • NAUTICAL_MILESThe unit of measure is nautical miles.
  • MILLIMETERSThe unit of measure is millimeters.
  • CENTIMETERSThe unit of measure is centimeters
  • METERSThe unit of measure is meters.
  • KILOMETERSThe unit of measure is kilometers.
  • DECIMETERSThe unit of measure is decimeters.
String

派生输出

名称说明数据类型
out_feature_class

The updated network feature class.

Feature Layer

代码示例

CreateLRSNetwork example 1 (Python window)

Use the CreateLRSNetwork tool in the Python window to create an LRS line network

# Name: CreateLRS_Line_Network_ex1.py
# Description: Creates an LRS Line Network with feet as the unit of measure.
# Requires: ArcGIS Location Referencing

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

# Tool variables
in_path = r"C:\UPDM_Data\LRS.gdb\LRS"
lrs_name = "LRS"
network_name = "LRSNetwork"
route_id_field = "RouteId"
route_name_field = "RouteName"
from_date_field = "FromDate"
to_date_field = "ToDate"
derive_from_line_network = "DO_NOT_DERIVE"
line_network_name = ""
include_fields_to_support_lines = "INCLUDE"
line_id_field = "LineId"
line_name_field = "LineName"
line_order_field = "LineOrder"
measure_unit = "Meters"

# Set current workspace
arcpy.env.workspace = "C:\UPDM_Data\LRS.gdb"

# Execute the tool
arcpy.CreateLRSNetwork_locref(in_path, lrs_name, network_name, route_id_field, route_name_field, from_date_field, to_date_field, derive_from_line_network, line_network_name, include_fields_to_support_lines, line_id_field, line_name_field, line_order_field, measure_unit)

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

Use the CreateLRSNetwork tool as a stand-alone Python script to create an LRS Network.

# Name: CreateLRSNetwork_ex2.py
# Description: Creates an LRS Network with miles as the unit of measure.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_Path = r"C:\UPDM_Data\LRS.gdb\LRS"
LRS_Name = "LRS"
Network_Name = "LRSNetwork"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"

# Execute the tool
arcpy.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date)

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

Use the CreateLRSNetwork tool as a stand-alone Python script to create an LRS line network.

# Name: CreateLRS_Line_Network_ex3.py
# Description: Creates an LRS Line Network with feet as the unit of measure.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables
Input_Path = r"C:\UPDM_Data\LRS.gdb\LRS"
LRS_Name = "LRS"
Network_Name = "EngineeringNetwork"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
Derive = "DO_NOT_DERIVE"
Derive_From = ""
Line_Support = "INCLUDE"
Line_ID = "LineId"
Line_Name = "LineName"
Line_Order = "LineOrder"
Unit = "Feet"

# Execute the tool
arcpy.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From, Line_Support, Line_ID, Line_Name, Line_Order, Unit)

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

Use the CreateLRSNetwork tool as a stand-alone Python script to create an LRS derived network.

# Name: CreateLRS_Derived_Network_ex4.py
# Description: Creates an LRS Derived Network with miles as the unit of measure.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy
 
# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Local variables:
Input_Path = r"C:\UPDM_Data\LRS.gdb\LRS"
LRS_Name = "LRS"
Network_Name = "LRSNetwork"
Route_ID = "RouteId"
Route_Name = "RouteName"
From_Date = "FromDate"
To_Date = "ToDate"
Derive = "DERIVE"
Derive_From = "EngineeringNetwork"

# Execute the tool
arcpy.CreateLRSNetwork_locref(Input_Path, LRS_Name, Network_Name, Route_ID, Route_Name, From_Date, To_Date, Derive, Derive_From)

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

环境

特殊情况

许可信息

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

相关主题