SummarizeRasterWithin

Title  SummarizeRasterWithin

Summary

Calculates statistics on values of a raster within the zones of another dataset.


Illustration

Summarize Raster Within tool Summarize Raster Within tool

Usage


Syntax

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.

  • Average— Calculates the average of all cells in the raster layer to be summarized that belong to the same zone as the output cell. This is the default.
  • Majority— Determines the value that occurs most often of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Maximum— Determines the largest value of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Median— Determines the median value of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Minimum— Determines the smallest value of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Minority— Determines the value that occurs least often of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Range— Calculates the difference between the largest and smallest value of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Standard deviation— Calculates the standard deviation of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Sum— Calculates the total value of all cells in the raster layer to be summarized that belong to the same zone as the output cell.
  • Variety— Calculates the number of unique values for all cells in the raster layer to be summarized that belong to the same zone as the output cell.
ignoreMissingValues (Optional)

Denotes whether missing values in the image service layer to summarize will influence the results of the zones that they fall within.

  • Checked—Within any particular zone, only cells that have a value in the image service layer being summarized will be used in determining the output value for that zone. Any missing or NoData cells will be ignored in the statistic calculation. This is the default.
  • Unchecked—Within any particular zone, if any cells in the image service layer being summarized do not have a value, it is deemed that there is insufficient information to perform statistical calculations for all the cells in that zone; therefore, the entire zone will receive the NoData value on the output image service.
processAsMultidimensional (Optional)

Determines how the input rasters will be processed if they are multidimensional.

  • Unchecked—Statistics will be calculated from the current slice of a multidimensional image service. This is the default.
  • Checked—Statistics will be calculated for all dimensions (such as time or depth) of a multidimensional image service.
  • CURRENT_SLICE— Statistics will be calculated from the current slice of a multidimensional image service. This is the default.
  • ALL_SLICES— Statistics will be calculated for all dimensions (such as time or depth) of a multidimensional image service.
percentileValue (Optional)

percentileInterpolationType (Optional)

context (Optional)

Code Samples

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)

                    

Tags

Credits

Use limitations