Aggregate Polygons (Data Management)

Combines polygons within a specified distance to each other into new polygons.


Illustration

Aggregate Polygons illustration

Usage tips

Syntax

AggregatePolygons_management (in_features, out_feature_class, aggregation_distance, minimum_area, minimum_hole_size, orthogonality_option)
Parameter Explanation Datatype
Input Features (Required)

The polygon features to be aggregated.

Feature Layer
Output Feature Class (Required)

The output feature class to be created.

Feature Class
Aggregation Distance (Required)

The distance to be satisfied between polygon boundaries for aggregation to happen. A distance must be specified, and it must be greater than zero. You can specify a preferred unit; the default is the feature unit.

Linear Unit
Minimum Area (Optional)

The minimum area for an aggregated polygon to be retained. The default value is zero, that is, to keep all polygons. You can specify a preferred unit; the default is the feature unit.

Areal Unit
Minimum Hole Size (Optional)

The minimum size of a polygon hole to be retained. The default value is zero, that is, to keep all polygon holes. You can specify a preferred unit; the default is the feature unit.

Areal Unit
Preserve orthogonal shape (Optional)

Specifies the characteristic of the input features that will be preserved when constructing the aggregated boundaries.

  • NON_ORTHOGONAL—Specifies natural features, such as vegetation or soil polygons, for which the non_orthogonal shapes will be preserved and constructed. This is the default.
  • ORTHOGONAL—Specifies building-like features for which orthogonal shapes will be preserved and constructed.

Boolean
Data types for geoprocessing tool parameters

Script Example

import arcgisscripting
gp = arcgisscripting.create()

gp.workspace = "h:\\workspace"
gp.toolbox = "management"
gp.aggregatepolygons("trees", "vegetation", 10, 150)
# AggregatePolygonsWithAttributeTransfer.py
# Description: Example of aggregating residential houses into builtup areas
# and then deriving the total population for the builtup areas.
# Author: ESRI
# Date: 04/23/08

# Create the Geoprocessor object
import arcgisscripting, sys, string, os
gp = arcgisscripting.create()

myWorkspace = "c:/data/urban_features.gdb"
myFeatures = "Houses"
try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    gp.Workspace = MyWorkspace
    # Given the input feature class named "Houses" with a field "COUNT" for family member count.
    #
    # Process: Aggregate Polygons  to create Builtup_areas polygons
    # and the one-to-many relationship table Builtup_areas_Tbl

    gp.AggregatePolygons_management(myFeatures, "Builtup_areas", "100 Meters", "0 Unknown", "0 Unknown", "ORTHOGONAL")
    # Process: Join Field to join Buildup_areas_Tbl using INPUT_FID as join field 
    #  with input Houses using the OBJECTID as join field, and specify COUNT as the field to transfer.
    #  This will transfer the COUNT field and its values into Builtup_areas_Tbl.
    gp.JoinField_management("Builtup_areas_Tbl", "INPUT_FID", myFeatures, "OBJECTID", "Count")
    # Process: Frequency on the Builtup_areas_Tbl using the OUTPUT_FID as the frequency field
    # and specify to summarize the COUNT values (total population). The output table Builtup_areas_Tbl_Frequency
    # will now contain the total population for each OUTPUT_FID.
    gp.Frequency_analysis("Builtup_areas_Tbl", "Builtup_areas_Tbl_Frequency", "OUTPUT_FID", "Count")
    # Process: Join Field again to join Builtup_areas using OBJECTID as join field 
    # with Builtup_areas_Tbl_Frequency table using the OUTPUT_FID as join field, and 
    # specify COUNT as the field to transfer. This will transfer the COUNT field and its values into 
    # Builtup_areas (the aggregated polygons).
    gp.JoinField_management("Builtup_areas", "OBJECTID", "Builtup_areas_Tbl_Frequency", "OUTPUT_FID", "Count")
except:
    # If an error occurred while running a tool print the messages
    print gp.GetMessages()

See Also

  • Dissolve (Data Management)
  • Simplify Polygon (Data Management)
  • Smooth Polygon (Data Management)
  • Aggregate Polygons (Coverage)