Dissolve (Data Management)
Illustration
Usage
-
The attributes of the features which 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'.
-
Dissolve can create very large features 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 display problems and/or have poor performance when drawn on a map or when edited. To avoid these potential problems, use the Create multipart features parameter's SINGLE_PART option to split potentially larger multipart features into many smaller features.
-
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 tool returns the number of values included in the statistical calculation, which in this case is 2.
-
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 could cause an error to occur, as the dissolve process may require more memory than is available. To prevent this, input features may be cut and processed 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 field(s) used in the dissolve process for the Frequency Field(s) 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. These can be evaluated and removed using either a second dissolve operation or using the merge edit task in ArcMap (1. start editing; 2. select the two features; 3. click Editor\Merge...)
-
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 and continue to build your model.
-
The Unsplit lines parameter with two options, DISSOLVE_LINES and UNSPLIT_LINES, only applies to line input. When the default DISSOLVE_LINES option is specified, lines are dissolved into a single feature. When UNSPLIT_LINES is specified, only two lines that have a common endpoint (known as pseudonode) are merged into one continuous line.
-
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.
Syntax
Parameter | Explanation | Data 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 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.
| Value Table |
multi_part (Optional) |
Specifies whether multipart features are allowed in the output feature class.
| Boolean |
unsplit_lines (Optional) |
Controls how line features are dissolved.
| Boolean |
Code Sample
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")
The following stand-alone script demonstrates how to use the Dissolve tool.
# Name: Dissolve_Example2.py # Description: Dissolve features based on common attributes # Author: ESRI # 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")