追踪网络属性

摘要

Describe 函数将返回追踪网络的以下属性。

追踪网络将返回 "TraceNetwork"dataType

了解有关追踪网络的详细信息

属性

属性说明数据类型
associationSource
(只读)

associationSource 对象。 此对象可用于检索关联源的属性。

Object
createDirtyAreaForAnyAttributeUpdate
(只读)

在启用了网络拓扑的情况下,是否针对任何属性更新创建脏区。

  • True - 将针对任何属性更新创建脏区。
  • False - 不会针对任何属性更新创建脏区。

Boolean
creationTime
(只读)

追踪网络的创建日期和时间。

DateTime
globalID
(只读)

追踪网络的全局 ID。

String
minimalDirtyAreaSize
(只读)

网络拓扑中脏区的最小大小。

Integer
networkAttributes
(只读)

networkAttributes 对象。 此对象可用于检索网络特性的属性。

Object
proVersion
(只读)

用于构建追踪网络的 ArcGIS Pro 版本。

String
schemaGeneration
(只读)

输入追踪网络的方案生成值。

Integer
sources
(只读)

sources 对象。 此对象可用于检索追踪网络源的属性。

Object
systemJunctionSource
(只读)

systemJunctionSource 对象。 此对象可用于检索系统交汇点源的属性。

Object

代码示例

追踪网络属性示例(独立脚本)

此独立 Python 脚本可打印某些追踪网络属性的报告。

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

# Import required modules
import arcpy

# Describe function on a Trace Network
TN = (r"C:\MyProject\MyNetworkData.gdb\FDS\HydroNetwork")
d = arcpy.Describe(TN)

# Top level TN properties
print("Creation Time: {0}".format(d.creationTime))
print("Pro Version: {0}".format(d.proVersion))
print("Global ID: {0}".format(d.globalId))
print("Schema generation: {0}".format(d.schemaGeneration))
print("Minimal dirty area size: {0}".format(d.minimalDirtyAreaSize))
print("Create Dirty Area For Any Attribute Update: {0}\n".format(d.createDirtyAreaForAnyAttributeUpdate))

# Association source properties
asources = d.associationSource
print("*** - Assocation Sources properties - ***")
print("Name: {0}".format(asources.name))
print("ID: {0}".format(asources.sourceID))
print("Type: {0} \n".format(asources.sourceType))

# System junction source properties
sjsources = d.systemJunctionSource
print("*** - System Junction Source properties - ***")
print("Name: {0}".format(sjsources.name))
print("ID: {0}".format(sjsources.sourceID))
print("Type: {0} \n".format(sjsources.sourceType))

# Source properties
sources = d.sources
for s in sources:
    print("*** - Sources properties - ***")
    print("Name: {0}".format(s.name))
    print("ID: {0}".format(s.sourceID))
    print("Source Type: {0} \n".format(s.sourceType))
    print("Element Type: {0} \n".format(s.elementType))
    cp = s.connectivityPolicies
    print("Connectivity Policy: {0} \n".format(cp.classConnectivity))

# Network Attribute properties
netattrs = d.networkAttributes
for na in netattrs:
    print("*** - Network Attribute properties - ***")
    print("ID: {0}".format(na.Id))
    print("Name: {0}".format(na.name))
    print("Data Type: {0}".format(na.dataType))
    print("Usage Type: {0}".format(na.usageType))
    print("isEmbedded: {0}".format(na.isEmbedded))
    print("isApportionable: {0}".format(na.isApportionable))
    print("bitPosition: {0}".format(na.bitPosition))
    print("bitSize: {0}".format(na.bitSize))
    print("Junction Weight ID: {0}".format(na.junctionWeightId))
    print("Edge Weight ID: {0} \n".format(na.edgeWeightId))

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

在本主题中