Calculates statistics on values of a raster within the zones of another dataset.
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 Layer ( inputZoneLayer in Python) is an image service, it must be an integer image service.
If the zone is a feature service, it will be converted to a raster internally, using the cell size and cell alignment from the value raster.
When the Cell size of the Input Zone Layer ( inputZoneLayer in Python) and the Input Raster Layer to Summarize (inputRasterLayertoSummarize in Python) 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 image service 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 Zone Layer does not overlap with the cell center of the input value raster image service, the zone will become NoData. To overcome this, you need to determine an appropriate raster resolution that will represent the detail of your image or feature service zone input, and use this resolution as the cell size in the Environment.
If the Input Zone Layer is a point feature service, 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 Layer has overlapping polygons, the zonal analysis will not be performed for each individual polygon. Since the feature service 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 Layer, 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 Raster Layer to Summarize can be either integer or floating point. However, when it is floating-point type, the options for calculating majority, median, minority, 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.
Parameter | Explanation |
---|---|
inputZoneLayer |
The input that defines the zones. Both raster and feature can be used for the zone input. |
zoneField |
The field that defines each zone. It can be an integer or a string field of the zone dataset. |
inputRasterLayertoSummarize |
Raster that contains the values on which to summarize a statistic. |
outputName |
The name of the output raster service. If the image service layer already exists, you will be prompted to provide another name. |
statisticType (Optional) |
Choose the statistic to calculate. The available options when the summarize raster is integer are Average, Majority, Maximum, Median, Minimum, Minority, Range, Standard deviation, Sum, and Variety. If the summarize raster is float, the options are Average, Maximum, Minimum, Range, Standard deviation, and Sum.
|
ignoreMissingValues (Optional) |
Denotes whether missing values in the image service layer to summarize will influence the results of the zones that they fall within.
|
processAsMultidimensional (Optional) |
Determines how the input rasters will be processed if they are multidimensional.
|
percentileValue (Optional) |
There is no explanation for this parameter. |
percentileInterpolationType (Optional) |
There is no explanation for this parameter. |
context (Optional) |
There is no explanation for this parameter. |
SummarizeRasterWithin 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.SummarizeRasterWithin_ra('https://MyPortal.esri.com/server/rest/services/Hosted/landuse/ImageServer', 'Landuse', 'https://MyPortal.esri.com/server/rest/services/Hosted/elevation/ImageServer', 'outRaster', 'MEAN', 'DATA')
SummarizeRasterWithin example 2 (stand-alone script)
This example determines for each zone the mean value in the raster layer to be summarized.
#------------------------------------------------------------------------------- # Name: SummarizeRasterWithin_Ex_02.py # Description: Calculates the maximum sea-surface temperature at different ecological zones. # Requirements: ArcGIS Image Server # Import system modules import arcpy # Set local variables inputZoneLayer = 'https://MyPortal.esri.com/server/rest/services/Hosted/zones/ImageServer' zoneField = 'temperature' inputRasterLayertoSummarize = 'https://MyPortal.esri.com/server/rest/services/Hosted/seaSurfaceTemperature/ImageServer' outputName = 'outSSTRaster' statisticType = 'MAXIMUM' ignoreMissingValues = '' processAsMultidimensional = 'ALL_SLICES' # Execute Multidimensional Summarize Raster Within operation arcpy.SummarizeRasterWithin_ra(inputZoneLayer, zoneField, inputRasterLayertoSummarize, outputName, statisticType, ignoreMissingValues)
There are no tags for this item.
There are no credits for this item.
There are no use limitations for this item.