Dissolve Network (Network Analyst)


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 works


Dissolve Network Illustration



DissolveNetwork_na (in_network_dataset, out_workspace_location)
ParameterExplanationData Type

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:

  • End point connectivity policy
  • An elevation policy of either None or Elevation Fields

The input network dataset must be built before it can be used in this tool.

Network Dataset Layer

The geodatabase workspace in which to create the dissolved network dataset. The workspace must be an ArcGIS 10 geodatabase or later.


Code Sample

DissolveNetwork example 1 (Python window)

Execute the tool using all parameters

import arcpy
arcpy.env.workspace = "C:/ArcTutor/Network Analyst/Tutorial/SanFrancisco.gdb"
DissolveNetwork example 2 (workflow)

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

    #Check out the Network Analyst extension license

    #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
    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)


Related Topics

Licensing Information

ArcView: Requires Network Analyst
ArcEditor: Requires Network Analyst
ArcInfo: Requires Network Analyst

Published 6/7/2010