Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Generalization toolset > Tools

Aggregate Polygons (Data Management) (ArcInfo only)

Release 9.3
Last modified March 8, 2012
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

NOTE: This topic was updated for 9.3.1.


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


Illustration


Aggregate Polygons illustration

Usage tips

Command line syntax
An overview of the Command Line window
AggregatePolygons_management <in_features> <out_feature_class> <aggregation_distance> {minimum_area} {minimum_hole_size} {NON_ORTHOGONAL | ORTHOGONAL}

Parameter Explanation Data Type
<in_features>

The polygon features to be aggregated.

Feature Layer
<out_feature_class>

The output feature class to be created.

Feature Class
<aggregation_distance>

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}

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}

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
{NON_ORTHOGONAL | ORTHOGONAL}

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


Command line example

aggregatepolygons_management c:\mapData.mdb\buildings h:\mapDataNew.mdb\residential_areas 5 25 orthogonal

Scripting syntax
About getting started with writing geoprocessing scripts
AggregatePolygons_management (in_features, out_feature_class, aggregation_distance, minimum_area, minimum_hole_size, orthogonality_option)

Parameter Explanation Data Type
in_features (Required)

The polygon features to be aggregated.

Feature Layer
out_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
orthogonality_option (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()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.