Aggregate Polygons (Cartography)

Summary

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

Illustration

Aggregate Polygons illustration

Usage

Syntax

AggregatePolygons_cartography (in_features, out_feature_class, aggregation_distance, {minimum_area}, {minimum_hole_size}, {orthogonality_option})
ParameterExplanationData 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 choose 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 output features when constructing the aggregated boundaries.

  • NON_ORTHOGONALOrganically shaped output features will be created. This is suitable for natural features, such as vegetation or soil polygons. This is the default.
  • ORTHOGONALOrthogonally shaped output features will be created. This option is suitable for preserving the geometric characteristic of anthropogenic input features, such as building footprints.
Boolean

Code Sample

AggregatePolygons tool example 1 (Python window)

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

import arcpy
from arcpy import env
import arcpy.cartography as CA
env.workspace = "C:/data"
CA.AggregatePolygons("buildings.shp", "C:/output/output.gdb/aggregated_buildings", 10)
AggregatePolygons tool example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the AggregatePolygons function.

# Name: AggregatePolygons_Example2.py
# Description: Aggregate grass features and then transfer attributes
 
# Import system modules
import arcpy
from arcpy import env
import arcpy.cartography as CA
import arcpy.management as DM
import arcpy.analysis as AN
  
# Set environment settings
env.workspace = "C:/data/Portland.gdb/Vegetation"
 
# Set local variables
inGrassFeatures = "grass"
aggregatedFeatures = "C:/data/PortlandOutput.gdb/grassland"
aggregatedTable = "C:/data/PortlandOutput.gdb/grassland_Tbl"
frequencyTable = "C:/data/PortlandOutput.gdb/frequency_Tbl"

# Aggregate grass polygons.
CA.AggregatePolygons(inGrassFeatures, aggregatedFeatures, 50, 300, 300, "NON_ORTHOGONAL")
 
# Join the aggregatedTable with input and
# transfer the COUNT field to aggregatedTable.
DM.JoinField(aggregatedTable, "INPUT_FID", inGrassFeatures, "OBJECTID", "COUNT")
 
# Use Frequency on aggregatedTable and
# obtain sum for COUNT.
AN.Frequency(aggregatedTable, frequencyTable, "OUTPUT_FID", "COUNT")

# Join the aggregatedFeatures with frequencyTable
# and transfer the COUNT field to aggregatedFeatures.
DM.JoinField(aggregatedFeatures, "OBJECTID", frequencyTable, "OUTPUT_FID", "COUNT")

Environments

Related Topics

Licensing Information

ArcView: No
ArcEditor: No
ArcInfo: Yes

11/11/2011