配置路径优先级规则 (位置参考)

摘要

配置一组规则以确定存在并发路径的网络中的主要路径。

使用情况

  • 顺序类型参数的数字选项仅支持数字,例如 1、2、11、22。 字母数字选项支持数字和文本,例如 1、2、11、22 和 1、11A、22A、22B。

  • 当使用字段参数配置多个字段时,字段值将按照添加字段的顺序连接。 例如,如果首先添加 RouteType 字段并且值为 SR,然后添加 RouteNumber 字段并且值为 18,则生成的串联字段为 SR18

    例如,如果 SR18 是包含 RouteType (SR) 和 RouteNumber (18) 字段的多字段路径 ID,请为字段参数选择 RouteTypeRouteNumber

  • 当填充按优先级排列的异常参数时,将首先通过按路径在列表中出现的顺序匹配异常,然后通过配置规则来确定路径优先级。 异常字段值是以逗号分隔的列表。

    例如,如果为 Route3、Route7 和 Route9 配置了按优先级排列的异常值,则在考虑任何已配置规则之前,这些异常将按照其列出顺序被视为主要路径。

参数

标注说明数据类型
LRS 网络要素类

输入要素类。 仅可使用已注册的 LRS 网络要素类。

Feature Layer
配置类型

指定将应用于 LRS 网络要素类参数值的配置类型。

  • 添加新规则将添加到配置中。
  • 更新将在配置中更新现有规则。
  • 删除将从配置中删除现有规则。
String
规则名称

将添加、更新或删除的规则名称。 规则名称最多可包含 30 个字符。

String
已更新的规则名称
(可选)

规则的更新名称。 此参数仅在将更新指定为配置类型参数值时使用。

String
源表名称
(可选)

注册到 LRS 网络要素类参数值的源事件表或要素类。 或者,可以使用网络要素类。 仅支持非跨线事件。

String
字段
(可选)

源表中的属性字段别名。 如果使用多个字段,它们将被串连起来。

String
排序方法
(可选)

指定路径优先级排序是否将由较小或较大的值确定。

  • 较小路径优先级排序是否将由较小的值确定。 这是默认设置。
  • 较大路径优先级排序是否将由较大的值确定。
String
排序类型
(可选)

指定在评估数字或字母数字字符串时将使用的排序类型。

  • 字母数字将使用字母数字顺序类型。 这是默认设置。
  • 数值将使用数字顺序类型。
String
按优先级排列的异常
(可选)

用户提供的异常的逗号分隔列表。

String

派生输出

标注说明数据类型
输出网络要素类

更新的 LRS 网络要素类。

Feature Layer

arcpy.locref.ConfigureRouteDominanceRules(in_feature_class, configure_type, rule_name, {updated_rule_name}, {source_table_name}, {fields}, {order_method}, {order_type}, {prioritized_exceptions})
名称说明数据类型
in_feature_class

输入要素类。 仅可使用已注册的 LRS 网络要素类。

Feature Layer
configure_type

指定将应用于 in_feature_class 参数值的配置类型。

  • ADD新规则将添加到配置中。
  • UPDATE将在配置中更新现有规则。
  • DELETE将从配置中删除现有规则。
String
rule_name

将添加、更新或删除的规则名称。 规则名称最多可包含 30 个字符。

String
updated_rule_name
(可选)

规则的更新名称。 此参数仅在将 UPDATE 指定为 configure_type 参数值时使用。

String
source_table_name
(可选)

注册到 in_feature_class 参数值的源事件表或要素类。 或者,可以使用网络要素类。 仅支持非跨线事件。

String
fields
[fields,...]
(可选)

源表中的属性字段别名。 如果使用多个字段,它们将被串连起来。

String
order_method
(可选)

指定路径优先级排序是否将由较小或较大的值确定。

  • LESSER路径优先级排序是否将由较小的值确定。 这是默认设置。
  • GREATER路径优先级排序是否将由较大的值确定。
String
order_type
(可选)

指定在评估数字或字母数字字符串时将使用的排序类型。

  • ALPHANUMERIC将使用字母数字顺序类型。 这是默认设置。
  • NUMERIC将使用数字顺序类型。
String
prioritized_exceptions
(可选)

用户提供的异常的逗号分隔列表。

String

派生输出

名称说明数据类型
out_feature_class

更新的 LRS 网络要素类。

Feature Layer

代码示例

ConfigureRouteDominanceRules 示例 1(Python 窗口)

演示了如何使用 Python 窗口中的 ConfigureRouteDominanceRules 函数添加路径优先级规则。

# Name: ConfigureRouteDominanceRules_Pro_ex1.py
# Description: Adds a rule to determine the dominant route in a network 
# where there are concurrent routes.
# Requirements: ArcGIS Location Referencing

# Local tool variables
in_feature_class = "C:\\LRdata\\LR.SDE\\LRSDataset\\RouteNetwork"
configure_type = "ADD"
rule_name = "Rule6"
updated_rule_name = ""
source_table_name = "FunctionalClass"
fields = "FunctionalClass"
order_method = "LESSER"
order_type = "NUMERIC"
prioritized_exceptions = ""

# Execute the tool
arcpy.locref.ConfigureRouteDominanceRules(in_feature_class, configure_type, rule_name, 
                                          updated_rule_name, source_table_name, fields, 
                                          order_method, order_type, prioritized_exceptions)
ConfigureRouteDominanceRules 示例 2(Python 窗口)

演示了如何使用 Python 窗口中的 ConfigureRouteDominanceRules 函数更新路径优先级规则。

# Name: ConfigureRouteDominanceRules_Pro_ex2.py
# Description: Updates a rule to determine the dominant route in a network 
# where there are concurrent routes.
# Requirements: ArcGIS Location Referencing

# Local tool variables
in_feature_class = "C:\\LRdata\\LR.SDE\\LRSDataset\\RouteNetwork"
configure_type = "UPDATE"
rule_name = "Rule6"
updated_rule_name = "Rule7"
source_table_name = "FunctionalClass"
fields = "FunctionalClass"
order_method = "GREATER"
order_type = "NUMERIC"
prioritized_exceptions = ""

# Execute the tool
arcpy.locref.ConfigureRouteDominanceRules(in_feature_class, configure_type, rule_name, 
                                          updated_rule_name, source_table_name, fields, 
                                          order_method, order_type, prioritized_exceptions)
ConfigureRouteDominanceRules 示例 3(独立脚本)

演示了如何使用独立脚本中的 ConfigureRouteDominanceRules 函数删除路径优先级规则。

# Name: ConfigureRouteDominanceRules_Pro_ex3.py
# Description: Deletes a route dominance rule from the configured rules as a stand-alone script.
# Requirements: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

# Local tool variables
in_feature_class = "C:\\LRdata\\LR.SDE\\LRSDataset\\RouteNetwork"
configure_type = "DELETE"
rule_name = "Rule3"
updated_rule_name = ""
source_table_name = ""
fields = None
order_method = ""
order_type = ""
prioritized_exceptions = ""

# Execute the tool
arcpy.locref.ConfigureRouteDominanceRules(in_feature_class, configure_type, rule_name, 
                                          updated_rule_name, source_table_name, fields, 
                                          order_method, order_type, prioritized_exceptions)

# Check in licenses
arcpy.CheckInExtension('LocationReferencing')
ConfigureRouteDominanceRules 示例 4(独立脚本)

演示了如何使用独立脚本中的 ConfigureRouteDominanceRules 函数添加具有异常的路径优先级规则。

# Name: ConfigureRouteDominanceRules_Pro_ex4.py
# Description: Add a rule as a stand-alone script with prioritized exceptions 
# to determine the dominant route in a network with concurrent routes.
# Requirements: ArcGIS Location Referencing

# Import arcpy module
import arcpy

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

# Local tool variables
in_feature_class = "C:\\LRdata\\LR.SDE\\LRSDataset\\RouteNetwork"
configure_type = "ADD"
rule_name = "Rule8"
updated_rule_name = ""
source_table_name = "RouteNetwork"
fields = "RouteName"
order_method = "LESSER"
order_type = "ALPHANUMERIC"
prioritized_exceptions = "US62"

# Execute the tool
arcpy.locref.ConfigureRouteDominanceRules(in_feature_class, configure_type, rule_name, 
                                          updated_rule_name, source_table_name, fields, 
                                          order_method, order_type, prioritized_exceptions)

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

环境

此工具不使用任何地理处理环境。

许可信息

  • Basic: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)
  • Standard: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)
  • Advanced: 需要 ArcGIS Location Referencing(ArcGIS Pipeline Referencing 或 ArcGIS Roads and Highways)

相关主题