Tabulate Area (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

Calculates cross-tabulated areas between two datasets and outputs a table.

Illustration

Tabulate Area illustration
TabulateArea(ZoneRas, "VALUE", ClassRas, "VALUE", Tabarea1.dbf, 1)

Usage

Syntax

TabulateArea (in_zone_data, zone_field, in_class_data, class_field, out_table, {processing_cell_size})
ParameterExplanationData 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. If no extension is specified, it will be an INFO table. If the location is in a geodatabase, the output table will be created in that particular type (for example, a file or ArcSDE geodatabase). If the name has a .dbf extension, the output will be in dBASE format.

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:

  • If the zone dataset is a raster, the cell size is the same as the zone raster.
  • If the zone dataset is a feature, the cell size is the shorter of the width or height of the extent of the zone feature dataset in the output spatial reference, divided by 250.

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

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Spatial Analyst
ArcGIS for Desktop Standard: Requires Spatial Analyst
ArcGIS for Desktop Advanced: Requires Spatial Analyst
4/10/2014