Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Generalization toolset > Tools

Dissolve (Data Management)

Release 9.3
Last modified March 8, 2012
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

NOTE: This topic was updated for 9.3.1.


Aggregates features based on specified attributes

Learn more about how Dissolve works.


Illustration


dissolve illustration

Usage tips

Command line syntax
An overview of the Command Line window
Dissolve_management <in_features> <out_feature_class> {dissolve_field; dissolve_field...} {field {statistic type}; field {statistic type}...} {MULTI_PART | SINGLE_PART} {DISSOLVE_LINES | UNSPLIT_LINES}

Parameter Explanation Data Type
<in_features>

The features to be aggregated.

Feature Layer
<out_feature_class>

The feature class to be created where the resulting features will be written.

Feature Class
{dissolve_field; dissolve_field...}

The field or fields on which to aggregate features.

The Add Field button, which is used only in ModelBuilder, allows you to add expected fields so you can complete the dialog box and continue to build your model.

Field
{field {statistic type}; field {statistic type}...}

Choose the statistics and fields with which to summarize attributes. Text attribute fields may be summarized using the statistics First or Last. Numeric attribute fields may be summarized using any statistic. Nulls are excluded from all statistical calculations.

  • FIRST — Finds the first record in the Input Table and uses its specified field value.
  • LAST — Finds the last record in the Input Table and uses its specified field value.
  • Numeric attribute fields may be summarized using any statistic: Sum, Mean, Max, Min, Range, Std, First, or Last.
  • SUM — Adds the total value for the specified field.
  • MEAN — Calculates the average for the specified field.
  • MIN — Finds the smallest value for all records of the specified field.
  • MAX — Finds the largest value for all records of the specified field.
  • RANGE — Finds the range of values (MAX – MIN) for the specified field.
  • STD — Finds the standard deviation on values in the specified field.
  • COUNT — Finds the number of values included in statistical calculations. This counts each value except null values. To determine the number of null values in a field, use the COUNT statistic on the field in question and a COUNT statistic on a different field that does not contain nulls (for example, the OID if present), then subtract the two values.

(Field String; Field String;...)
{MULTI_PART | SINGLE_PART}

Specifies whether multipart features are allowed in the output feature class.

  • MULTI_PART — Specifies multipart features are allowed. This is the default.
  • SINGLE_PART — Specifies multipart features are not allowed. Instead of creating multipart features, an individual feature will be created for each part.

Boolean
{DISSOLVE_LINES | UNSPLIT_LINES}

Controls how line features are dissolved.

  • DISSOLVE_LINES — Lines are dissolved into a single feature. This is the default.
  • UNSPLIT_LINES — Lines are only dissolved when two lines have an end vertex in common.

Boolean
Data types for geoprocessing tool parameters


Command line example

workspace E:\arcgis\ArcTutor\BuildingaGeodatabase\Montgomery.mdb
Dissolve_management landbase\parcels landbase\zoning zoning "RES FIRST"

Scripting syntax
About getting started with writing geoprocessing scripts
Dissolve_management (in_features, out_feature_class, dissolve_field, statistics_fields, multi_part, unsplit_lines)

Parameter Explanation Data Type
in_features (Required)

The features to be aggregated.

Feature Layer
out_feature_class (Required)

The feature class to be created where the resulting features will be written.

Feature Class
dissolve_field (Optional)

The field or fields on which to aggregate features.

The Add Field button, which is used only in ModelBuilder, allows you to add expected fields so you can complete the dialog box and continue to build your model.

Field
statistics_fields (Optional)

Choose the statistics and fields with which to summarize attributes. Text attribute fields may be summarized using the statistics First or Last. Numeric attribute fields may be summarized using any statistic. Nulls are excluded from all statistical calculations.

  • FIRST — Finds the first record in the Input Table and uses its specified field value.
  • LAST — Finds the last record in the Input Table and uses its specified field value.
  • Numeric attribute fields may be summarized using any statistic: Sum, Mean, Max, Min, Range, Std, First, or Last.
  • SUM — Adds the total value for the specified field.
  • MEAN — Calculates the average for the specified field.
  • MIN — Finds the smallest value for all records of the specified field.
  • MAX — Finds the largest value for all records of the specified field.
  • RANGE — Finds the range of values (MAX – MIN) for the specified field.
  • STD — Finds the standard deviation on values in the specified field.
  • COUNT — Finds the number of values included in statistical calculations. This counts each value except null values. To determine the number of null values in a field, use the COUNT statistic on the field in question and a COUNT statistic on a different field that does not contain nulls (for example, the OID if present), then subtract the two values.

(Field String; Field String;...)
multi_part (Optional)

Specifies whether multipart features are allowed in the output feature class.

  • MULTI_PART — Specifies multipart features are allowed. This is the default.
  • SINGLE_PART — Specifies multipart features are not allowed. Instead of creating multipart features, an individual feature will be created for each part.

Boolean
unsplit_lines (Optional)

Controls how line features are dissolved.

  • DISSOLVE_LINES — Lines are dissolved into a single feature. This is the default.
  • UNSPLIT_LINES — Lines are only dissolved when two lines have an end vertex in common.

Boolean

Data types for geoprocessing tool parameters


Script example

# DissolveByUnique.py
# Description: Divide a line geodatabase feature class into several based on the unique values in a 
#              field.  Output will be dissolved to remove pseudonodes (if any).
# Author: ESRI
# Date: 1/1/04

import arcgisscripting, sys, string, os
gp = arcgisscripting.create()

try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    gp.workspace = "C:/data/Transportation.mdb"

    # Set the input feature class    
    fc = "transport"

    # Set the field to create a list of unique values    
    fieldname = "ROAD_CLASS"

    # Open a Search Cursor to identify all unique values
    rows = gp.SearchCursor(fc)
    row = rows.Next()

    # Set a list variable to hold all unique values
    L = []

    # Using a while loop, cursor through all records and append unique values to the list variable
    while row:
        value = row.GetValue(fieldname)
        if value not in L:
            L.append(value)
        row = rows.Next()

    # Sort the list variable
    L.sort()

    # If a value in the list variable is blank, remove it from the list variable
    if ' ' in L:
        L.remove(' ')

    # Use MakeFeatureLayer to create a selectable layer
    gp.MakeFeatureLayer(fc, "dissolveLYR")

    # Loop through the list variable
    x = 0
    for item in L:

        # Concatenate the query
        query = "[" + fieldname + "]" + " = '" + L[x] + "'"

        # Create a selection on the layer with the current unique value (i.e., L[x])
        gp.SelectLayerByAttribute("dissolveLYR", "NEW_SELECTION", query)

        # Use Dissolve to create new feature class based on layer selection, output feature class 
        # will share name of unique value 
        gp.Dissolve_management("dissolveLYR", L[x], fieldname)
        x = x + 1

except:
    # If an error occurred while running a tool, print the messages
    print gp.getmessages()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.