Skip to main content

网络属性特性

汇总

公共设施网络中的 networkAttributes 对象支持下列属性。

属性

属性 说明 数据类型

assignments

(只读)

assignments 对象。 该对象可用于检索网络属性分配的属性。

Object

bitPosition

(只读)

网络属性的位占位值。

Integer

bitSize

(只读)

网络属性的位大小值。

Integer

creationTime

(只读)

网络属性的创建日期和时间。

DateTime

dataType

(只读)

网络属性的数据类型 - 例如,整型或双精度型。

String

edgeWeightID

(只读)

网络属性的边权重 ID 值。

Integer

fieldType

(只读)

网络属性字段的数据类型 - 例如,短整型或长整型、双精度型或日期。

String

isApportionable

(只读)

描述网络属性是否可分配的布尔值。

  • True - 网络属性可分配。

  • False - 网络属性不可分配。

Boolean

ID

(只读)

网络属性的 ID。

Integer

isEmbedded

(只读)

描述网络属性是否可嵌入的布尔值。

  • True - 网络属性可嵌入。

  • False - 网络属性不可嵌入。

Boolean

isNullable

(只读)

描述网络属性是否可为空(允许空值)的布尔值。

  • True - 网络属性可为空。

  • False - 网络属性不允许空值。

Boolean

isOverridable

(只读)

描述网络属性是否可以被覆盖的布尔值。

  • True - 网络属性可以被覆盖。

  • False - 网络属性不可被覆盖。

Boolean

isSubstitution

(只读)

描述网络属性是否可用于替换的布尔值。

  • True - 网络属性可用于替换。

  • False - 网络属性不可用于替换。

Boolean

junctionWeightID

(只读)

网络属性的交汇点权重 ID 值。

Integer

name

(只读)

网络属性的名称。

String

networkAttributeToSubstitute

(只读)

用于属性替换的值。

了解有关 高级网络属性属性替换 的详细信息。

String

usageType

(只读)

网络属性的使用类型 - 例如,终端 ID、源 ID 和资产组。

String

代码示例

公共设施网络的网络属性特性示例(独立脚本)

以下独立 Python 脚本可打印某些公共设施网络属性的报告。

'''****************************************************************************
Name:        DescribeUtilityNetworkProperties.py
Description: This script reports the properties of a utility network
Created by:  Esri
****************************************************************************'''

# Import required modules
import arcpy

# Describe function on a Utility Network
UN = "C:\\MyProject\\databaseConn.sde\\mygdb.USER1.Naperville\\mygdb.USER1.ElectricNetwork"
d = arcpy.Describe(UN)

# Network Attribute properties
netattrs = d.networkAttributes
for na in netattrs:
    print("*** - Network Attribute properties - ***")
    print(f"ID: {na.Id}")
    print(f"Name: {na.name}")
    print(f"Network Attribute To Substitute: {na.networkAttributeToSubstitute}")
    print(f"Data Type: {na.dataType}")
    print(f"Field Type: {na.fieldType}")
    print(f"Usage Type: {na.usageType}")
    print(f"isEmbedded: {na.isEmbedded}")
    print(f"isApportionable: {na.isApportionable}")
    print(f"isOverridable: {na.isOverridable}")
    print(f"isSubstitution: {na.isSubstitution}")
    print(f"Domain name: {na.domainName}")
    print(f"bitPosition: {na.bitPosition}")
    print(f"bitSize: {na.bitSize}")
    print(f"Junction Weight ID: {na.junctionWeightId}")
    print(f"Edge Weight ID: {na.edgeWeightId} \n")

    # For each attribute assignment in the attribute assignments object:
    try:
        unas = na.assignments
        for una in unas:
            print(" -- Attribute Assignment Properties -- ")
            print(f"Utility Network Assignment Attribute ID: {una.networkAttributeId}")
            print(f"Utility Network Assignment Attribute Source Name: {una.networkSourceName} \n")
            # For each field evaluator in the attribute evaluator object:
            print(" - Field Evaluator Properties - ")
            fe = una.evaluator
            print(f"Field Evaluator Type: {fe.evaluatorType}")
            print(f"Field Evaluator Name: {fe.fieldName} \n")
    except:
        print(f"{na.name} does not have any attribute assignments \n")