ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Connectivity Policies

  • 描述
  • 属性
  • 代码示例

描述

提供有关边源和交汇点源所使用的连通性策略的信息。名称中包含 "X" 的属性为动态属性。"X" 的可能值取决于其他属性。例如,对于给定的边源,connSubtypeX 和 connPolicyX 为动态属性,属性中的 X 表示特定的子类型。X 值的允许范围取决于 subTypeConnCount 属性。因此,如果边源具有两个子类型,那么它将支持 connSubtype0、connSubtype1、connPolicy0 和 connPolicy1 属性。

属性

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

针对边源和交汇点源。

指示给定边源或交汇点源是否通过子类型确定连通性组和策略的布尔值。

Boolean
classConnectivity
(只读)

针对边源和交汇点源。

用于指示确定给定边源中的所有边元素或给定交汇点源中的交汇点元素彼此之间连接方式的策略。如果给定边源或交汇点源的 usesSubtypes 属性返回了 True,则不应将此属性用于确定连通性策略。在此情况下,应使用特定子类型的 connPolicyX 属性。

此属性返回以下边源关键字:

  • EndVertex
  • AnyVertex

此属性返回以下交汇点源关键字:

  • 覆盖
  • 支持
String
subtypeConnCount
(只读)

针对边源和交汇点源。

用于定义给定边源或交汇点源连通性策略的子类型总数。如果 usesSubtypes 属性返回 False,则此属性返回 0。

Integer
connSubtypeX
(只读)

针对边源和交汇点源。

用于定义给定边要素源或交汇点要素源的子类型的子类型代码。connSubtypeX 是一种动态属性,仅在 subTypeConnCount 值大于 0 时才受支持。

Integer
connPolicyX
(只读)

针对边源和交汇点源。

用于指示确定给定边源中特定子类型的所有边元素或给定交汇点源中特定子类型的所有交汇点元素彼此之间连接方式的策略。connPolicyX 是一种动态属性,仅在 subTypeConnCount 值大于 0 时才受支持。

此属性返回以下边源关键字:

  • EndVertex
  • AnyVertex

此属性返回以下交汇点源关键字:

  • 覆盖
  • 支持
String
defaultGroup
(只读)

仅限边源。

此边要素源所参与的连通性组。

如果 usesSubtypes 属性返回 True,则此属性返回 -1。在这种情况下,使用特定子类型的 groupNameX 属性。

Integer
groupCount
(只读)

仅限边源。

用于定义给定边源连通性组的子类型总数。如果 usesSubtypes 属性返回 False,则此属性返回 0。

Integer
groupSubtypeX
(只读)

仅限边源。

用于定义给定边要素源的子类型的子类型代码。groupSubtypeX 是一种动态属性,仅在 groupCount 值大于 0 时才受支持。

Integer
groupNameX
(只读)

仅限边源。

给定边要素源的特定子类型参与的连接组。groupNameX 是一种动态属性,仅在 groupCount 值大于 0 时才受支持。

String
defaultGroupsCount
(只读)

仅限交汇点源。

给定交汇点源所属连通性组的总数。如果 usesSubtypes 属性返回 True,则使用 subtypeXGroupsCount 属性确定给定交汇点源的特定子类型所属连通性组的总数。

如果 usesSubtypes 属性返回 True,则此属性返回 0。

Integer
defaultGroupNameX
(只读)

仅限交汇点源。

此交汇点要素源所参与的连通性组。defaultGroupNameX 是一种动态属性,仅在 defaultGroupsCount 值大于 0 时才受支持。X 值的允许范围取决于 defaultGroupsCount 属性。

String
subtypeGroupCount
(只读)

仅限交汇点源。

用于定义给定交汇点源连通性组的子类型总数。如果 usesSubtypes 属性返回 False,则此属性返回 0。

Integer
subtypeGroupX
(只读)

仅限交汇点源。

用于定义给定交汇点要素源的子类型(由 X 指示)的子类型代码。subtypeGroupX 是一种动态属性,仅在 subtypeGroupCount 值大于 0 时才受支持。

Integer
subtypeXGroupsCount
(只读)

仅限交汇点源。

给定交汇点源的特定子类型(由 X 指示)所属连通性组的总数。subtypeXGroupsCount 是一种动态属性,仅在 subTypeGroupCount 值大于 0 时才受支持。

Integer
subtypeXGroupNameX
(只读)

仅限交汇点源。

给定边要素源的特定子类型参与的连接组。groupNameX 是一种动态属性,仅在 groupCount 值大于 0 时才受支持。

String

代码示例

连通性策略属性示例 1

显示网络数据集中边源的连通性策略信息。

# Name: NDSConnectivityPolicies_ex01.py
# Description: Prints out the connectivity policy information about the
#              edge sources for a given network dataset 

import arcpy
import sys

# Set workspace
arcpy.env.workspace = "C:/Data/Paris.gdb/Transportation"

#Create a Describe object from the network dataset
desc = arcpy.Describe("ParisMultimodal_ND")

justify = 35
print ("------- Edge sources") 

# Get all the edge sources for the network dataset 
edgeSources = desc.edgeSources 

#If there are no edge sources, quit
if not edgeSources:
    print ("%*s" % (justify, "(No edge sources)")) 
    sys.exit(0)

for edgeSource in edgeSources:
    print (" %*s: %s" % (justify, "Source Name" , edgeSource.name))
    print (" %*s: %s" % (justify, "Source ID" , str(edgeSource.sourceID))) 
    print (" %*s: %s" % (justify, "Source Type", edgeSource.sourceType))
    print (" %*s: %s" % (justify, "Element Type", edgeSource.elementType))
    print (" %*s: %s" % (justify, "From Elevation Field",
                         edgeSource.fromElevationFieldName))
    print (" %*s: %s" % (justify, "To Elevation Field",
                         edgeSource.toElevationFieldName))
    # Get connectivity information
    conn = edgeSource.connectivityPolicies 
    # Check if subtypes are used for edge sources to define connectivity groups
    #and policies
    bUseSubtypes = conn.usesSubtypes 
    print(" %*s: %s" % (justify, "Connectivity defined by subtype?",
                        str(conn.usesSubtypes)))
    
    #Print connectivity policy information depending on the use of subtypes 
    if not bUseSubtypes:
        print("%*s: %s" %(justify,"Connectivity Policy",conn.classConnectivity)) 
    else: 
        # Connectivity policy by subtype
        print(" %*s: %s" % (justify, "Number of subtypes",
                            str(conn.subtypeConnCount))) 
        for i in range(0, conn.subtypeConnCount):
            subtypeCode = getattr(conn, "connSubtype" + str(i)) 
            policy = getattr(conn, "connPolicy" + str(i))
            print(" %*s: %s" %(justify, "Subtype Code",subtypeCode))  
            print(" %*s: %s" % (justify, "... has connectivity policy", policy))
    
    # Print connectivity Group information depending on the use of subtypes
    if not bUseSubtypes: 
        print("%*s: %s" % (justify,"Belongs to Connectivity Group",
                           conn.defaultGroup))         
    else: 
        # Connectivity group by subtype
        print(" %*s: %s" %(justify,"Number of subtypes for connectivity groups",
                          conn.groupCount))
        for i in range(0, conn.groupCount): 
            subtypeCode = getattr(conn, "groupSubtype" + str(i)) 
            name = getattr(conn, "groupName" + str(i)) 
            print( "%*s: %s" %(justify,"Subtype Code", subtypeCode)) 
            print("%*s: %s" %(justify,"... belongs to connectivity group",name))
    print(" ")
连通性策略属性示例 2

显示网络数据集中交汇点源的连通性策略信息。

# Name: NDSConnectivityPolicies_ex02.py
# Description: Prints out the connectivity policy information about the
#              junction sources for a given network dataset 

import arcpy
import sys

# Set workspace
arcpy.env.workspace = "C:/Data/Paris.gdb/Transportation"

#Create a Describe object from the network dataset
desc = arcpy.Describe("ParisMultimodal_ND")

justify = 35
print ("------- Junction sources") 

#Get all the junction sources for the network dataset
junctions = desc.junctionSources

#If there are no junction sources, quit
if not junctions: 
    print " %*s" % (justify, "(No junction sources)")    
    sys.exit(0) 
 
for junction in junctions:
    print (" %*s: %s" % (justify, "Source Name" , junction.name))
    print (" %*s: %s" % (justify, "Source ID" , str(junction.sourceID))) 
    print (" %*s: %s" % (justify, "Source Type", junction.sourceType))
    print (" %*s: %s" % (justify, "Element Type", junction.elementType))
    print (" %*s: %s" % (justify, "Elevation Field",
                         junction.elevationFieldName)) 

    # system junctions do not support connectivity information 
    sourcetype = junction.sourceType 
    if sourcetype.lower() != "junctionfeature":  
        continue 
    #Get the connectivity policies
    conn = junction.connectivityPolicies 
    if not conn:  
        continue 
    # Connectivity can be defined based on subtypes 
    bUseSubtypes = conn.usesSubtypes 
    print (" %*s: %s" % (justify + 5, "Connectivity defined by subtype?" , 
                         str(conn.usesSubtypes))) 
    if not bUseSubtypes: 
        print (" %*s: %s" % (justify + 5, "Connectivity policy" , 
                             conn.classConnectivity)) 
        outtext = "Belongs to %d different connectivity groups" % conn.defaultGroupsCount 
        print " %*s" % (justify + 5, outtext) 
        defgrouplist = []
        for i in range(0,conn.defaultGroupsCount): 
            defgrouplist.append(str(getattr(conn, "defaultGroupName" + str(i))))
        print ("%*s: %s" % (justify + 5,"... belongs to connectivity group(s)",
                            " ".join(defgrouplist))) 
    else: 
        print (" %*s: %s" % (justify + 5, "Number of subtypes" ,
                             str(conn.subtypeConnCount)))
        for i in range(0, conn.subtypeConnCount): 
            st = getattr(conn, "connSubtype" + str(i))
            policy = getattr(conn,"connPolicy" + str(i))
            print (" ")
            print (" %*s: %s" % (justify + 10, "Subtype value" , st)) 
            print (" %*s: %s" % (justify + 10, "...has connectivity policy" ,
                                  policy)) 
        
        print ("") 
        for i in range(0, conn.subtypeGroupCount): 
            stGroup = getattr(conn, "subtypeGroup" + str(i)) 
            print (" %*s: %d" % (justify + 10, "Subtype value", stGroup)) 
            count = getattr(conn, "subtype" + str(i) + "GroupsCount")
            grouplist = []
            for j in range(0, count): 
                key = getattr(conn,"subtype%dGroupName%d" % (i,j))
                grouplist.append(str(key)) 
            print (" %*s %s" % (justify + 10, "...belongs to connectivity group(s)",
                                " ".join(grouplist))) 
            
            print ("") 
    print (" ")

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明