Focal Statistics

ToolBox Implementation .NET Implementation
Derives value for the output calls from a neighborhood of cells centered in the output cell. The neighborhood is with user defined shape (square or circle) and size (width or diameter) in number of cells.

Neighborhoods:

Square - Width = 3

Square - Width = 5

Circle - Diameter = 3

Circle - Diameter = 5

Inputs:

Output:

Example:

Notes:

ToolBox implementation

Command line syntax

ETS_GPFocalStatistics <Input Raster>  <Out Raster> <Statistics Type> <Neighborhood Type> <Neighborhood Size>

Parameters

Expression Explanation
<Input Raster> A Raster dataset or Raster layer
<Out Raster> A String - the full name of the output raster (A raster with the same full name should not exist). The output raster type depends on the extension of the output file(see Notes above)
<Statistics Type> A String - the type of the statistics to be calculated.  Valid values
  • Sum
  • Min
  • Max
  • Range
  • Mean
  • STD
  • Median
  • Major
  • Minor
  • Variety
<Neighborhood Type> A String - the neighborhood type. Valid values: Square and Circle
<Neighborhood Size> An integer - the side of the square or the diameter of the circle in pixels/number of cells. This should be an odd number.

Scripting syntax

ETS_GPFocalStatistics (Input Raster, Out Raster, Statistics Type, Neighborhood Type, Neighborhood Size)

See the explanations above:
<> - required parameter
{} - optional parameter

.NET implementation
(Go to TOP)

FocalStatistics (inRasterDataset As IRasterDataset2, sOutRaster As String, sStatsType As String, sNeighborhoodType As String, iSize As Integer) As IRasterDataset2

Copyright © Ianko Tchoukanski