Available with Spatial Analyst license.
Summary
Calculates cross-tabulated areas between two datasets and outputs a table.
Illustration
Usage
A zone is defined as all areas in the input that have the same value. The areas do not have to be contiguous. Both raster and feature can be used for the zone input.
If the Input raster or feature zone data (in_zone_data in Python) or the Input raster or feature class data (in_class_data in Python) is a raster, it must be an integer raster.
If both the inputs are rasters and their cell sizes are different, the output cell size will be the Maximum Of Inputs. The Input raster or feature class data (in_class_data in Python) will be used as the Snap Raster internally. If the cell size is the same, but the cells are not aligned, the class data will be used as the snap raster internally. Either of these cases will trigger an internal resampling before the zonal operation is performed.
When the zone and class inputs are both rasters of the same cell size and the cells are aligned, they will be used directly in the tool. They will not be resampled internally during tool execution.
If the Input raster or feature zone data (in_zone_data in Python) is a feature and the Input raster or feature class data (in_class_data in Python) is a raster, the zone data will be converted to a raster internally, using the cell size and cell alignment from the class data.
If the Input raster or feature class data (in_class_data in Python) is a feature and the Input raster or feature zone data (in_zone_data in Python) is a raster, the class data will be converted to a raster internally, using the cell size and cell alignment from the zone data.
If both the inputs are features, the Extent will be the Minimum Of Inputs, the cell size will be the shorter of the width or height of the extent of the zone feature dataset, in the output spatial reference, divided by 250.
If the Input raster or feature zone data (in_zone_data in Python) has overlapping polygons, the zonal analysis will not be performed for each individual polygon. Since the feature input is converted to a raster, each location can only have one value.
An alternative method is to process the zonal operation iteratively for each of the polygon zones and collate the results.
When specifying the input zone or class data, the default field will be the first available integer or text field. If no other valid fields exist, the ObjectID field (for example, OID or FID) will be the default.
If a point or line is used as the Input raster or feature class data (in_class_data in Python), the area intersected by those features will be reported.
The output of the Tabulate Area tool is a table.
In this table:
- There will be a record for each unique value of the zone dataset.
- There will be a field for each unique value of the class dataset.
- Each record will store the area of each class within each zone.
See Working with Tabulate Area for explanations of certain issues that may be encountered with this tool and suggestions on how to work around them.
See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.
Syntax
TabulateArea (in_zone_data, zone_field, in_class_data, class_field, out_table, {processing_cell_size})
Parameter | Explanation | Data Type |
in_zone_data | Dataset that defines the zones. The zones can be defined by an integer raster or a feature layer. | Raster Layer; Feature Layer |
zone_field | Field that holds the values that define each zone. It can be an integer or a string field of the zone dataset. | Field |
in_class_data | The dataset that defines the classes that will have their area summarized within each zone. The class input can be an integer raster layer or a feature layer. | Raster Layer; Feature Layer |
class_field | The field that holds the class values. It can be an integer or a string field of the input class data. | Field |
out_table | Output table that will contain the summary of the area of each class in each zone. The format of the table is determined by the output location and path. By default, the output will be a geodatabase table. If the path is not in a geodatabase, the format is determined by the extension. If the extension is .dbf, it will be in dBASE format. If no extension is specified, the output will be an INFO table. | Table |
processing_cell_size (Optional) | The processing cell size for the zonal operation. This is the value in the environment if specifically set. If the environment is not set, the default for the cell size is determined by the type of the zone data as follows:
| Analysis Cell Size |
Code sample
TabulateArea example 1 (Python window)
This example returns a table with the area of each class value that is contained within each zone.
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
TabulateArea("zonedata.shp", "IDStr", "valueraster", "VALUE",
"C:/sapyexamples/output/areatable.dbf", 2)
TabulateArea example 2 (stand-alone script)
This example returns a table with the area of each class value that is contained within each zone.
# Name: TabulateArea_Ex_02.py
# Description: Calculates cross tabulated areas between two datasets.
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
env.extent = "classgrid"
env.snapRaster = "classgrid"
# Set local variables
inZoneData = "zonedata.shp"
zoneField = "IDStr"
inClassData = "valueraster"
classField = "VALUE"
outTable = "C:/sapyexamples/output/areatable02.dbf"
processingCellSize = 2
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute TabulateArea
TabulateArea(inZoneData, zoneField, inClassData, classField, outTable,
processingCellSize)
Environments
Licensing information
- ArcGIS Desktop Basic: Requires Spatial Analyst
- ArcGIS Desktop Standard: Requires Spatial Analyst
- ArcGIS Desktop Advanced: Requires Spatial Analyst