融合网络 (Network Analyst)

许可等级:BasicStandardAdvanced

摘要

创建可最大程度减少正确构建输入网络数据集模型所需线要素数目的网络数据集。提高输出网络数据集的效率,便可减少求解分析、绘制结果和生成驾车指示所需的时间。此工具将输出新网络数据集和源要素类;输入网络数据集及其源要素保持不变。

了解有关“融合网络”工作原理的详细信息

插图

Dissolve Network Illustration

用法

语法

DissolveNetwork_na (in_network_dataset, out_workspace_location)
参数说明数据类型
in_network_dataset

要融合的网络数据集。

输入网络数据集必须是只有一个边源的文件地理数据库或个人地理数据库网络数据集。允许任意数目的交汇点源和转弯源。边源必须具有:

  • 端点连通性策略
  • “无”或“高程字段”高程策略

必须先构建输入网络数据集,之后才能在此工具中使用。

Network Dataset Layer
out_workspace_location

要创建融合的网络数据集的地理数据库工作空间。工作空间必须为 ArcGIS 10 地理数据库或更高版本,并且必须是与输入网络数据集所在的地理数据库不同的地理数据库。

Workspace

代码实例

融合网络 (DissolveNetwork) 示例 1(Python 窗口)

使用所有参数执行此工具。

import arcpy
arcpy.env.workspace = "C:/ArcTutor/Network Analyst/Tutorial/SanFrancisco.gdb"
arcpy.na.DissolveNetwork("Transportation/Streets_ND","C:/Data/DissolvedNet.gdb")
融合网络 (DissolveNetwork) 示例 2(工作流)

以下独立 Python 脚本演示了如何使用融合网络 (DissolveNetwork) 工具创建具有更少线要素的新网络数据集。

# Name: DissolveNetwork_Workflow.py
# Description: Creates a new network dataset with reduced number of line 
#              features in a new file geodatabase workspace. After dissolving,
#              the network dataset is also built so that it can be used to 
#              perform network analyses.
# Requirements: Network Analyst Extension 

#Import system modules
import arcpy
from arcpy import env

try:
    #Check out the Network Analyst extension license
    arcpy.CheckOutExtension("Network")

    #Set environment settings
    env.workspace = "C:/data/SanFrancisco.gdb"
    env.overwriteOutput = True
    
    #Set local variables
    inNetworkDataset = "Transportation/Streets_ND"
    outFolder = "C:/data/output"
    outputGDBName = "SanFranciscoDissolved"
    
    #Create a new file geodatabase that will contain the dissolved network
    result = arcpy.management.CreateFileGDB(outFolder, outputGDBName)
    
    #Get the path to the newly created file gdb from the result object.    
    outputGDB = result.getOutput(0)
    
    #Dissolve the network dataset
    result = arcpy.na.DissolveNetwork(inNetworkDataset, outputGDB)
    
    #Get the path to the dissolved network dataset from the result object
    dissolvedNetworkDataset = result.getOutput(0)
    
    #The dissolved network dataset is unbuilt. So build the network dataset
    arcpy.na.BuildNetwork(dissolvedNetworkDataset)
    
    print "Script completed successfully"

except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occured on line %i" % tb.tb_lineno
    print str(e)

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 需要 Network Analyst
ArcGIS for Desktop Standard: 需要 Network Analyst
ArcGIS for Desktop Advanced: 需要 Network Analyst
5/10/2014