Pairwise Dissolve (Analysis)

Summary

Aggregates features based on specified attributes using a parallel processing approach.

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

Illustration

Dissolve illustration

Usage

  • The attributes of the features that become aggregated by dissolve 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 following naming standard of statistic type + underscore + input field name. For example, if the SUM statistic is used on a field named POP, the output will have a field named SUM_POP.

  • Very large features can be created in the output feature class. This is especially true when there is a small number of unique values in the Dissolve Field(s) or when dissolving all features into a single feature. Very large features may cause processing or display problems or may have 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 then this output was moved to a machine with less available memory. To avoid these potential problems, uncheck Create multipart features (multi_part="SINGLE_PART" in Python) to split potentially larger multipart features into many smaller features. For extremely large features, the Dice tool may have to be used to split the large features in order to solve processing, display, or performance problems.

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

  • The Dissolve Field(s) parameter's Add Field button is used only in ModelBuilder. In ModelBuilder, where the preceding tool has not been run, or its derived data does not exist, the Dissolve Field(s) parameter may not be populated with field names. The Add Field button allows you to add expected fields so you can complete the tool's dialog box and continue to build your model.

  • If the Input Features geometry type is either point or multipoint and Create multipart features is checked (multi_part="MULTI_PART" in Python), the output will be a multipoint feature class. Otherwise, if Create multipart features is unchecked (multi_part="SINGLE_PART" in Python), the output will be a point feature class.

  • By default, curve features from the input will be densified in the output. To support curves in the output, use the Maintain Curve Segments environment.

  • The Pairwise Dissolve tool honors the Parallel Processing Factor environment. If the environment is not set (the default) or is set to 100, full parallel processing will be enabled and the tool will attempt to distribute the work to all the logical cores on the machine. Setting the environment to 0 will disable parallel processing. Specifying a factor between 1 and 99 will cause the tool to determine the percentage of logical cores to use by applying the formula (Parallel Processing Factor / 100 * Logical Cores) rounded up to the nearest integer. If the result of this formula is 0 or 1, parallel processing will not be enabled.

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_Field(s)
(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 Field(s)
(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 statistical 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 statistical 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.
Value Table
Create multipart features
(Optional)

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

  • Checked—Specifies multipart features are allowed. This is the default.
  • Unchecked—Specifies multipart features are not allowed. Instead of creating multipart features, individual features will be created for each part.
Boolean

arcpy.analysis.PairwiseDissolve(in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {multi_part})
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 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)

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 statistical 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 statistical 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 thee 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.
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

Code sample

PairwiseDissolve example 1 (Python window)

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

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

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

# Name: PairwiseDissolve_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"]
 
# 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.PairwiseDissolve_analysis(tempLayer, outFeatureClass, dissolveFields, "", 
                                "SINGLE_PART")

Licensing information

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

Related topics