Dissolve Network (Network Analyst)

License Level:BasicStandardAdvanced

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 works

Illustration

Dissolve Network Illustration

Usage

Syntax

DissolveNetwork_na (in_network_dataset, out_workspace_location)
ParameterExplanationData 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:

  • 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
out_workspace_location

The geodatabase workspace in which to create the dissolved network dataset. The workspace must be an ArcGIS 10 geodatabase or later, and it must be a different geodatabase than the one where the input network dataset resides.

Workspace

Code Sample

DissolveNetwork example 1 (Python window)

Execute the tool using all parameters.

network = "C:/Data/SanFrancisco.gdb/Transportation/Streets_ND"
out_gdb = "C:/Data/DissolvedNetwork.gdb"
arcpy.na.DissolveNetwork(network, out_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. 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
    network = "Transportation/Streets_ND"
    out_folder = "C:/Data"
    output_gdb_name = "SanFranciscoDissolved"
    
    #Create a new file geodatabase that will contain the dissolved network
    output_gdb = arcpy.management.CreateFileGDB(out_folder,
                                                output_gdb_name).getOutput(0)
    
    #Dissolve the network dataset
    result = arcpy.na.DissolveNetwork(network, output_gdb)
    
    #Get the path to the dissolved network dataset from the result object
    dissolved_network = result.getOutput(0)
    
    #The dissolved network dataset is unbuilt, so build it
    arcpy.na.BuildNetwork(dissolved_network)
    
    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))

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Network Analyst
ArcGIS for Desktop Standard: Requires Network Analyst
ArcGIS for Desktop Advanced: Requires Network Analyst
1/20/2015