Aggregate Polygons (Data Management) (ArcInfo only) |
|
Release 9.3
Last modified March 8, 2012 |
![]() ![]() ![]() Print all topics in : "Tools" |
NOTE: This topic was updated for 9.3.1.
Combines polygons within a specified distance to each other into new polygons
Illustration
Usage tips
This tool is intended for moderate scale reduction and aggregation, when input features can no longer be represented individually due to limited map space or required data resolution. Aggregation will only happen where two polygon boundaries are within the specified aggregation distance to each other. There will be no self-aggregation, meaning no aggregation within an input polygon feature itself along its boundary, and no aggregation between any parts of a multipart polygon feature.
The output feature class will not contain any geographic attributes from the input features. A one-to-many relationship table with the name of output_feature_class_Tbl will be created that links the aggregated polygons to their source polygons. This table will contain two fields, OUTPUT_FID and INPUT_FID, storing the aggregated feature IDs and their source feature IDs respectively. The link can become incorrect when any of the input or output features are modified. With this link, you can derive necessary attributes for the output features from their source features using appropriate geoprocessing tools. An example script for aggregating residential houses into built-up areas and then deriving the total population for the built-up areas is given in the Script Example session below.
Some connecting zones (where features are joined) may be too narrow as a result of connecting narrow features or as a result of constructing squared shapes for the ORTHOGONAL option; therefore, further inspection and editing may be necessary.
For the ORTHOGONAL option, the larger the aggregation distance is, the more chances it will have for overlapping features, output feature crossing input feature, or other cartographically unpleasant shapes. During the process, if an invalid geometry (such as a self-intersecting polygon) is created and the situation cannot be resolved automatically, a repaired valid geometry will be written out, and a warning message will be printed indicating that visually self-intersecting geometry was created for that feature. Postinspection and editing may be necessary.
If the input features contain Z values, the Z values can be preserved if specified in the Environmental Settings. Where the output vertices fall on input feature vertices, the input Z values will be carried over to the output vertices; otherwise, a Z value will be derived for a new vertex, taking an existing Z value or through interpolation.
The following environment settings affect this tool: XY tolerance, Extent, M domain, Coordinate system, Output has M values, Output has Z values, Default Z value, Output XY domain, workspace, and scratch workspace.
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.
|
Boolean |
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.
|
Boolean |
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()