Calculates the values of a raster within the zones of another dataset and reports the results to a table.
A zone is defined as all areas in the input that have the same value. The areas do not have to be contiguous. Both image and feature services can be used for the zone input.
If the Input Zone Raster or Features (inputZoneRasterOrFeatures in Python) is a raster, it must be an integer raster.
If the zone is a feature, it will be converted to a raster internally, using the cell size and cell alignment from the Input Value Raster (inputValueRaster in Python).
When the Cell size of the Input Zone Raster or Features and the Input Value Raster is different, the output cell size will be the Maximum Of Inputs, and the value raster image service will be used as the Snap Raster internally. If the cell size is same, but the cells are not aligned, the value raster 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 value inputs are both rasters of the same cell size and the cells are aligned, they will be used directly in the tool, and will not be resampled internally during the tool execution.
If the Input raster or feature zone data is a feature, for any of the zone features that do not overlap any cell centers of the value raster, those zones will not get converted to the internal zone raster. As a result, those zones will not be represented in the output. You can manage this by determining an appropriate value for the Cell Size environment that will preserve the desired level of detail of the feature zones, and specify it in the analysis environment.
If the Input Zone Raster or Features is a point feature, it is possible to have more than one point contained within any particular cell of the value input raster. For such cells, the zone value is determined by the point with the lowest ObjectID field (for example, OID or FID).
If the Input Zone Raster or Features has overlapping features, the zonal analysis will be performed for each individual feature.
When specifying the Input raster or feature zone data the default zone 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.
The Input Value Raster can be either integer or floating point. However, when it is floating-point type, the options for calculating majority, median, minority, percentile and variety will not be available. For majority and minority calculations, when there is a tie, the output for the zone is based on the lowest of the tied values.
Supported multidimensional dataset types include multidimensional image service.
A field or series of fields will be created in the output table, depending on the chosen Statistics Type (statisticsType in Python). The number of rows in the output table will represent the number of zones.
Parameter | Explanation |
---|---|
inputZoneRasterOrFeatures |
The input that defines the zones. Both raster and feature can be used for the zone input. |
inputValueRaster |
Raster that contains the values on which to summarize a statistic. |
outputTableName |
The name of the output table. If the table already exists, you will be prompted to provide another name. |
zoneField |
The field that defines each zone. It can be an integer or a string field of the zone dataset. |
ignoreNodata (Optional) |
Denotes whether NoData values in the value input will influence the results of the zone that they fall within.
|
statisticType (Optional) |
Choose the statistic to calculate. The available options when the value raster is integer are All, Mean, Majority, Maximum, Median, Minimum, Minority, Percentile, Range, Standard deviation, Sum, Variety, Minimum and Maximum, Mean and Standard deviation, and Minimum, Maximum and Mean. If the value raster is float, the options are All, Mean, Maximum, Minimum, Range, Standard deviation, and Sum.
|
percentileValues |
The percentile to calculate. The default is 90, for the 90th percentile. The values can range from 0 to 100. The 0th percentile is essentially equivalent to the Minimum statistic, and the 100th Percentile is equivalent to Maximum. A value of 50 will produce essentially the same result as the Median statistic. This option is only available if the Statistics Type parameter is set to Percentile or All. This option is only available if the statisticsType parameter is set to PERCENTILE or ALL. |
processAsMultidimensional (Optional) |
Determines how the input rasters will be processed if they are multidimensional.
|
percentileInterpolationType (Optional) |
There is no explanation for this parameter. |
context (Optional) |
There is no explanation for this parameter. |
ZonalStatisticsAsTable example 1 (Python window)
This example determines for each zone the average of cell values in the raster layer to be summarized.
import arcpy arcpy.ZonalStatisticsasTable_ra('https://MyPortal.esri.com/server/rest/services/Hosted/landuse/ImageServer', 'https://MyPortal.esri.com/server/rest/services/Hosted/elevation/ImageServer', 'outTable', 'Landuse', '', 'MEAN')
ZonalStatisticsAsTable example 2 (stand-alone script)
This example determines for each zone the statistics value in the raster layer to be summarized.
#------------------------------------------------------------------------------- # Name: ZonalStatisticsasTable_Ex_02.py # Description: Calculates all statistics with defined percentile values # for sea-surface temperature defined by ecological zones. # Requirements: ArcGIS Image Server # Import system modules import arcpy # Set local variables inputZoneRasterOrFeatures = 'https://MyPortal.esri.com/server/rest/services/Hosted/zones/ImageServer' inputValueRaster = 'https://MyPortal.esri.com/server/rest/services/Hosted/seaSurfaceTemperature/ImageServer' outputTableName = 'outZSAT' zoneField = 'temperature' ignoreNodata = '' statisticType = 'ALL' percentileValues = [25,75,90] processAsMultidimensional = 'ALL_SLICES' # Execute Multidimensional Zonal Statistics as Table arcpy.ZonalStatisticsasTable_ra(inputZoneRasterOrFeatures, inputValueRaster, outputTableName, zoneField, ignoreNodata, statisticType, percentileValues, processAsMultidimensional)
There are no tags for this item.
There are no credits for this item.
There are no use limitations for this item.