Dissolve (Data Management)

Summary

Aggregates features based on specified attributes.

An alternate tool is available for dissolve operations. See the Pairwise Dissolve tool documentation for details.

Learn more about how Dissolve works

Illustration

Dissolve tool illustration
Dissolve tool illustration

Usage

  • The attributes of the features that are aggregated by this tool can be summarized or described using a variety of statistics. The statistic used to summarize attributes is added to the output feature class as a single field with the naming standard of statistic type + underscore + input field name. For example, if the SUM statistics type is used on a field named POP, the output will include a field named SUM_POP.

  • Dissolve can create very large features in the output feature class, especially when there is a small number of unique values in the Dissolve Fields parameter or when dissolving all features into a single feature. Very large features may cause processing or display problems or poor performance when drawn on a map or when edited. Problems may also occur if the dissolve output created a feature at the maximum size on one machine and this output was moved to a machine with less available memory. To avoid these potential problems, use the Create multipart features parameter to create single-part features to split potentially larger multipart features into many smaller features. For extremely large features created by the Dissolve tool, the Dice tool can be used to split the large features to solve processing, display, or performance problems.

  • Null values are excluded from all statistical calculations. For example, the average of 10, 5, and a null is 7.5 ((10 + 5) / 2). The count returns the number of values included in the statistical calculation, which in this case is 2.

  • This tool will use a tiling process to handle very large datasets for better performance and scalability. For more details, see Geoprocessing with large datasets.

  • The availability of physical memory may limit the amount (and complexity) of input features that can be processed and dissolved into a single output feature. This limitation may cause an error to occur, as the dissolve process may require more memory than is available. To prevent this, Dissolve may divide and process the input features using an adaptive tiling algorithm. To determine the features that have been tiled, run the Frequency tool on the result of this tool, specifying the same fields used in the dissolve process for the Frequency Fields parameter. Any record with a frequency value of 2 has been tiled. Tile boundaries are preserved in the output features to prevent the creation of features that are too large to be used by ArcGIS.

    Caution:

    Running Dissolve on the output of a previous dissolve process will rarely reduce the number of features in the output when the original processing divided and processed the inputs using adaptive tiling. The maximum size of any output feature is determined by the amount of available memory at run time; output containing tiles is an indicator that dissolving further with the available resources will cause an out-of-memory situation or result in a feature that is unusable. Additionally, running the Dissolve tool a second time on output that was created this way may result in slow performance for little to no gain and may cause an unexpected failure.

  • The Unsplit lines parameter only applies to line input. When the default is specified, lines are dissolved into a single feature; otherwise, only two lines that have a common endpoint (known as a pseudonode) are merged into one continuous line.

  • If the Input Features parameter value's geometry type is either point or multipoint and the Create multipart features parameter is checked, the output will be a multipoint feature class. Otherwise, if the Create multipart features parameter is unchecked, the output will be a point feature class.

Parameters

LabelExplanationData Type
Input Features

The features to be aggregated.

Feature Layer
Output Feature Class

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

Feature Class
Dissolve Fields
(Optional)

The field or fields on which features will be aggregated.

Field
Statistics Fields
(Optional)

Specifies the numeric field or fields containing the attribute values that will be used to calculate the specified statistic. Multiple statistic and field combinations can be specified. Null values are excluded from all calculations.

Text attribute fields can be summarized using first and last statistics. Numeric attribute fields can be summarized using any statistic.

Available statistics types are as follows:

  • Sum—The values for the specified field will be added together.
  • Mean—The average for the specified field will be calculated.
  • Minimum—The smallest value for all records of the specified field will be found.
  • Maximum—The largest value for all records of the specified field will be found.
  • Range—The range of values (maximum minus minimum) for the specified field will be calculated.
  • Standard deviation—The standard deviation of values in the specified field will be calculated.
  • Count—The number of values included in the calculations will be found. Each value will be counted except null values. To determine the number of null values in a field, create a count on the field in question, create a count on a different field that does not contain null values (for example, the OID if present), and subtract the two values.
  • First—The specified field value of the first record in the input will be used.
  • Last—The specified field value of the last record in the input will be used.
  • Median—The median for all records of the specified field will be calculated.
  • Variance—The variance for all records of the specified field will be calculated.
  • Unique—The number of unique values of the specified field will be counted.
  • Concatenate—The values for the specified field will be concatenated. The values can be separated using the Concatenation Separator parameter.
Value Table
Create multipart features
(Optional)

Specifies whether multipart features will be allowed in the output feature class.

  • Checked—Multipart features will be allowed in the output feature class. This is the default.
  • Unchecked—Multipart features will not be allowed in the output feature class. Individual features will be created for each part.
Boolean
Unsplit lines
(Optional)

Specifies how line features will be dissolved.

  • Unchecked—Lines will be dissolved into a single feature. This is the default.
  • Checked—Lines will only be dissolved when two lines have an end vertex in common.
Boolean
Concatenation Separator
(Optional)

A character or characters that will be used to concatenate values when the Concatenation option is used for the Statistics Fields parameter.

String

arcpy.management.Dissolve(in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {multi_part}, {unsplit_lines}, {concatenation_separator})
NameExplanationData 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 features will be aggregated.

Field
statistics_fields
[[field, {statistic_type}],...]
(Optional)

Specifies the numeric field or fields containing the attribute values that will be used to calculate the specified statistic. Multiple statistic and field combinations can be specified. Null values are excluded from all calculations.

Text attribute fields can be summarized using first and last statistics. Numeric attribute fields can be summarized using any statistic.

Available statistics types are as follows:

  • SUM—The values for the specified field will be added together.
  • MEAN—The average for the specified field will be calculated.
  • MIN—The smallest value for all records of the specified field will be found.
  • MAX—The largest value for all records of the specified field will be found.
  • RANGE—The range of values (maximum minus minimum) for the specified field will be calculated.
  • STD—The standard deviation of values in the specified field will be calculated.
  • COUNT—The number of values included in the calculations will be found. Each value will be counted except null values. To determine the number of null values in a field, create a count on the field in question, create a count on a different field that does not contain null values (for example, the OID if present), and subtract the two values.
  • FIRST—The specified field value of the first record in the input will be used.
  • LAST—The specified field value of the last record in the input will be used.
  • MEDIAN—The median for all records of the specified field will be calculated.
  • VARIANCE—The variance for all records of the specified field will be calculated.
  • UNIQUE—The number of unique values of the specified field will be counted.
  • CONCATENATE—The values for the specified field will be concatenated. The values can be separated using the concatenation_separator parameter.
Value Table
multi_part
(Optional)

Specifies whether multipart features will be allowed in the output feature class.

  • MULTI_PARTMultipart features will be allowed in the output feature class. This is the default.
  • SINGLE_PARTMultipart features will not be allowed in the output feature class. Individual features will be created for each part.
Boolean
unsplit_lines
(Optional)

Specifies how line features will be dissolved.

  • DISSOLVE_LINESLines will be dissolved into a single feature. This is the default.
  • UNSPLIT_LINESLines will only be dissolved when two lines have an end vertex in common.
Boolean
concatenation_separator
(Optional)

A character or characters that will be used to concatenate values when the CONCATENATION option is used for the statistics_fields parameter.

String

Code sample

Dissolve example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data/Portland.gdb/Taxlots"
arcpy.management.Dissolve("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 function.

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

# Import system modules
import arcpy

arcpy.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"]

# Run MakeFeatureLayer and SelectLayerByAttribute.  This is only to exclude 
# features that are not desired in the output.
arcpy.management.MakeFeatureLayer(inFeatures, tempLayer)
arcpy.management.SelectLayerByAttribute(tempLayer, "NEW_SELECTION", expression)

# Run Dissolve using LANDUSE and TAXCODE as Dissolve Fields
arcpy.management.Dissolve(tempLayer, outFeatureClass, dissolveFields, "", 
                          "SINGLE_PART", "DISSOLVE_LINES")

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics