Dissolve (Data Management)

License Level:BasicStandardAdvanced

Summary

Aggregates features based on specified attributes.

Learn more about how Dissolve works

Illustration

Dissolve illustration
Dissolve illustration

Usage

Syntax

Dissolve_management (in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {multi_part}, {unsplit_lines})
ParameterExplanationData Type
in_features

The features to be aggregated.

Feature Layer
out_feature_class

The feature class to be created that will contain the aggregated features.

Feature Class
dissolve_field
[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
[[field, {statistic_type}],...]
(Optional)

The fields and statistics 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 Features and uses its specified field value.
  • LAST—Finds the last record in the Input Features and uses its specified field value.
  • 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 which does not contain nulls (for example, the OID if present), then subtract the two values.
Value Table
multi_part
(Optional)

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

  • MULTI_PARTSpecifies multipart features are allowed. This is the default.
  • SINGLE_PARTSpecifies multipart features are not allowed. Instead of creating multipart features, individual features will be created for each part.
Boolean
unsplit_lines
(Optional)

Controls how line features are dissolved.

  • DISSOLVE_LINESLines are dissolved into a single feature. This is the default.
  • UNSPLIT_LINESLines are only dissolved when two lines have an end vertex in common.
Boolean

Code Sample

Dissolve example 1 (Python window)

The following Python window script demonstrates how to use the Dissolve tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data/Portland.gdb/Taxlots"
arcpy.Dissolve_management("taxlots", "C:/output/output.gdb/taxlots_dissolved",
                          ["LANDUSE", "TAXCODE"], "", "SINGLE_PART", 
                          "DISSOLVE_LINES")
Dissolve example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the Dissolve tool.

# Name: Dissolve_Example2.py
# Description: Dissolve features based on common attributes

 
# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "C:/data/Portland.gdb/Taxlots"
 
# Set local variables
inFeatures = "taxlots"
tempLayer = "taxlotsLyr"
expression = arcpy.AddFieldDelimiters(inFeatures, "LANDUSE") + " <> ''"
outFeatureClass = "C:/output/output.gdb/taxlots_dissolved"
dissolveFields = ["LANDUSE", "TAXCODE"]
 
# Execute MakeFeatureLayer and SelectLayerByAttribute.  This is only to exclude 
#  features that are not desired in the output.
arcpy.MakeFeatureLayer_management(inFeatures, tempLayer)
arcpy.SelectLayerByAttribute_management(tempLayer, "NEW_SELECTION", expression)
 
# Execute Dissolve using LANDUSE and TAXCODE as Dissolve Fields
arcpy.Dissolve_management(tempLayer, outFeatureClass, dissolveFields, "", 
                          "SINGLE_PART", "DISSOLVE_LINES")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013