Dissolve Network (Network Analyst)
Summary
Creates a network dataset that minimizes the number of line features required to correctly model the input network dataset. The more efficient output network dataset reduces the time required to solve analyses, draw results, and generate driving directions. This tool outputs a new network dataset and source feature classes; the input network dataset and its source features remain unchanged.
Learn more about how Dissolve Network worksIllustration
Usage
-
This tool does not create a built network. Use the Build Network tool to build the newly created network dataset prior to performing any analysis on it.
-
The network dataset and feature classes created in the output geodatabase workspace have the same feature dataset name, network dataset name, and feature class names as the input network dataset. The tool fails to execute if any datasets with these names already exist in the output geodatabase workspace.
-
Only fields from the source feature class that are used by the network dataset are transferred to the output line feature class. Examples of fields include:
- Elevation fields
- Fields used in network attribute evaluators (length, time, one-way restrictions, hierarchy, and so on)
- Fields used in generating driving directions (Street names, Shield, and so on)
Syntax
Parameter | Explanation | Data Type |
in_network_dataset |
The network dataset to be dissolved. The input network dataset must be a file or personal geodatabase network dataset with exactly one edge source. Any number of junction sources and turn sources is allowed. The edge source must have:
The input network dataset must be built before it can be used in this tool. | Network Dataset Layer |
out_workspace_location |
The geodatabase workspace in which to create the dissolved network dataset. The workspace must be an ArcGIS 10 geodatabase or later. | Workspace |
Code Sample
Execute the tool using all parameters
import arcpy arcpy.env.workspace = "C:/ArcTutor/Network Analyst/Tutorial/SanFrancisco.gdb" arcpy.DissolveNetwork_na("Transportation/Streets_ND","C:/Data/DissolvedNet.gdb")
The following stand-alone Python script demonstrates how the DissolveNetwork tool can be used to create a new network dataset with a reduced number of line features.
# Name: DissolveNetwork_Workflow.py # Description: Creates a new network dataset with reduced number of line # features in a new file geodatabase workspace. The network dataset # is also built so that it can be used to perform network analyses. # Requirements: Network Analyst Extension # Author: ESRI #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.CreateFileGDB_management(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.DissolveNetwork_na(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.BuildNetwork_na(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)