com.esri.arcgis.geoprocessing.tools.cartographytools
Class AggregatePolygons
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.cartographytools.AggregatePolygons
- All Implemented Interfaces:
- GPTool
public class AggregatePolygons
- extends AbstractGPTool
Combines polygons within a specified distance to each other into new polygons.
The Aggregate Polygons tool is contained in the Cartography Tools tool box.
Illustration:
Usage tips:
- This tool is intended for moderate scale reduction and aggregation, when input features can no longer be represented individually due to the limited map space or the 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 builtup areas and then deriving the total population for the builtup 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 may result in 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. Post inspection 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.
- Learn more about spatial reference and geoprocessing
- 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.
Constructor Summary |
AggregatePolygons()
Creates the Aggregate Polygons tool with defaults. |
AggregatePolygons(java.lang.Object inFeatures,
java.lang.Object outFeatureClass,
java.lang.Object aggregationDistance)
Creates the Aggregate Polygons tool with the required parameters. |
Method Summary |
java.lang.Object |
getAggregationDistance()
Returns the Aggregation Distance parameter of this tool . |
java.lang.Object |
getInFeatures()
Returns the Input Features parameter of this tool . |
java.lang.Object |
getMinimumArea()
Returns the Minimum Area parameter of this tool . |
java.lang.Object |
getMinimumHoleSize()
Returns the Minimum Hole Size parameter of this tool . |
java.lang.String |
getOrthogonalityOption()
Returns the Preserve orthogonal shape parameter of this tool . |
java.lang.Object |
getOutFeatureClass()
Returns the Output Feature Class parameter of this tool . |
java.lang.Object |
getOutTable()
Returns the Output Table parameter of this tool (Read only). |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
void |
setAggregationDistance(java.lang.Object aggregationDistance)
Sets the Aggregation Distance parameter of this tool . |
void |
setInFeatures(java.lang.Object inFeatures)
Sets the Input Features parameter of this tool . |
void |
setMinimumArea(java.lang.Object minimumArea)
Sets the Minimum Area parameter of this tool . |
void |
setMinimumHoleSize(java.lang.Object minimumHoleSize)
Sets the Minimum Hole Size parameter of this tool . |
void |
setOrthogonalityOption(java.lang.String orthogonalityOption)
Sets the Preserve orthogonal shape parameter of this tool . |
void |
setOutFeatureClass(java.lang.Object outFeatureClass)
Sets the Output Feature Class parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AggregatePolygons
public AggregatePolygons()
- Creates the Aggregate Polygons tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
AggregatePolygons
public AggregatePolygons(java.lang.Object inFeatures,
java.lang.Object outFeatureClass,
java.lang.Object aggregationDistance)
- Creates the Aggregate Polygons tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inFeatures
- Feature Layer, the polygon features to be aggregated.outFeatureClass
- Feature Class, the output feature class to be created.aggregationDistance
- Linear Unit, 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.
getInFeatures
public java.lang.Object getInFeatures()
- Returns the Input Features parameter of this tool .
This parameter is Feature Layer, the polygon features to be aggregated.
This is a required parameter.
- Returns:
- the Input Features
setInFeatures
public void setInFeatures(java.lang.Object inFeatures)
- Sets the Input Features parameter of this tool .
This parameter is Feature Layer, the polygon features to be aggregated.
This is a required parameter.
- Parameters:
inFeatures
- Feature Layer, the polygon features to be aggregated.
getOutFeatureClass
public java.lang.Object getOutFeatureClass()
- Returns the Output Feature Class parameter of this tool .
This parameter is Feature Class, the output feature class to be created.
This is a required parameter.
- Returns:
- the Output Feature Class
setOutFeatureClass
public void setOutFeatureClass(java.lang.Object outFeatureClass)
- Sets the Output Feature Class parameter of this tool .
This parameter is Feature Class, the output feature class to be created.
This is a required parameter.
- Parameters:
outFeatureClass
- Feature Class, the output feature class to be created.
getAggregationDistance
public java.lang.Object getAggregationDistance()
- Returns the Aggregation Distance parameter of this tool .
This parameter is Linear Unit, 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.
This is a required parameter.
- Returns:
- the Aggregation Distance
setAggregationDistance
public void setAggregationDistance(java.lang.Object aggregationDistance)
- Sets the Aggregation Distance parameter of this tool .
This parameter is Linear Unit, 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.
This is a required parameter.
- Parameters:
aggregationDistance
- Linear Unit, 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.
getMinimumArea
public java.lang.Object getMinimumArea()
- Returns the Minimum Area parameter of this tool .
This parameter is Areal Unit, 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.
This is an optional parameter.
- Returns:
- the Minimum Area
setMinimumArea
public void setMinimumArea(java.lang.Object minimumArea)
- Sets the Minimum Area parameter of this tool .
This parameter is Areal Unit, 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.
This is an optional parameter.
- Parameters:
minimumArea
- Areal Unit, 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.
getMinimumHoleSize
public java.lang.Object getMinimumHoleSize()
- Returns the Minimum Hole Size parameter of this tool .
This parameter is Areal Unit, 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.
This is an optional parameter.
- Returns:
- the Minimum Hole Size
setMinimumHoleSize
public void setMinimumHoleSize(java.lang.Object minimumHoleSize)
- Sets the Minimum Hole Size parameter of this tool .
This parameter is Areal Unit, 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.
This is an optional parameter.
- Parameters:
minimumHoleSize
- Areal Unit, 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.
getOrthogonalityOption
public java.lang.String getOrthogonalityOption()
- Returns the Preserve orthogonal shape parameter of this tool .
This parameter is String, specifies the characteristic of the input features that will be preserved when constructing the aggregated boundaries.
This is an optional parameter.
- Returns:
- the Preserve orthogonal shape
setOrthogonalityOption
public void setOrthogonalityOption(java.lang.String orthogonalityOption)
- Sets the Preserve orthogonal shape parameter of this tool .
This parameter is String, specifies the characteristic of the input features that will be preserved when constructing the aggregated boundaries.
This is an optional parameter.
- Parameters:
orthogonalityOption
- String, 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.
getOutTable
public java.lang.Object getOutTable()
- Returns the Output Table parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Output Table
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias