Calculate Areas (Spatial Statistics)
Summary
Calculates area values for each feature in a polygon feature class.
Illustration
Usage
-
The F_AREA field created in the Output Feature Class will be populated with values for the area of each polygon feature in square units of the Output_Coordinate_System.
There are alternative methods for creating an Area field for polygon features including: Calculate_Field and the Geometry Calculator.
The Output Feature Class is a copy of the Input Feature Class with the additional (or updated) F_AREA field containing polygon areas.
-
This tool is useful for determining a weight for intra-zonal interaction.
-
This tool can be used to calculate an Area value for a study area polygon. The Average Nearest Neighbor tool, for example, has an Area parameter.
The F_AREA field is created in the Output Feature Class to store calculated Area values. If a field of this name already exists in the Input Feature Class, it will be overwritten in the Output Feature Class.
When using shapefiles, keep in mind that they cannot store null values. Tools or other procedures that create shapefiles from non-shapefile inputs may store or interpret null values as zero. This can lead to unexpected results. See also Geoprocessing considerations for shapefile output.
Syntax
Parameter | Explanation | Data Type |
Input_Feature_Class |
The input polygon feature class. | Feature Layer |
Output_Feature_Class |
The output feature class. This feature class is a copy of the input feature class with field F_AREA added (or updated). The F_AREA field contains the polygon area. | Feature Class |
Code Sample
The following Python Window script demonstrates how to use the CalculateAreas tool.
import arcpy arcpy.env.workspace = "c:/data" arcpy.CalculateAreas_stats("tracts.shp", "tracts_with_area_field.shp")
The following stand-alone Python script demonstrates how to use the CalculateAreas tool.
# Calculate AREA values # Import system modules import arcpy # Local variables... workspace = "C:/data" input = "tracts.shp" calculate_output = "tracts_with_area_field.shp" try: # Set the current workspace (to avoid having to specify the full path to the feature classes each time) arcpy.env.workspace = workspace # Process: Calculate Areas... arcpy.CalculateAreas_stats(input, calculate_output) except: # If an error occurred when running the tool, print out the error message. print arcpy.GetMessages()
Environments
- Output Coordinate System
Feature geometry is projected to the Output Coordinate System prior to analysis.