Dissolve

Title  Dissolve

Summary

Agrega feições baseado em atributos específicos.


Illustration

Dissolve illustration Dissolve illustration

Usage


Syntax

Parameter Explanation
in_features

Feições a serem agregadas.

out_feature_class (Optional)

Feição resultante que contem as feições agregadas.

dissolve_field (Optional)

The field or fields on which to aggregate features.

multi_part (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.

unsplit_lines (Optional)

Controls how line features are dissolved. Unchecked—Lines are dissolved into a single feature. This is the default. Checked—Lines are only dissolved when two lines have an end vertex in common.

esri_out_feature_service_name (Optional)

The name of the optional feature service to create on the federated server containing the result of this tool. If no name is specified an output feature service will not be created.

Code Samples

Dissolve example 1 (Python window)

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


import arcpy
arcpy.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

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.Dissolve_management(tempLayer, outFeatureClass, dissolveFields, "", 
                          "SINGLE_PART", "DISSOLVE_LINES")

                    

Tags

Credits

Use limitations