This document is archived and information here might be outdated.  Recommended version.


INeighborhoodOp.FocalStatistics Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (SpatialAnalyst)  

INeighborhoodOp.FocalStatistics Method

Calculates statistics for an overlapping neighborhood.

[Visual Basic .NET]
Public Function FocalStatistics ( _
    ByVal geoDataset As IGeoDataset, _
    ByVal Type As esriGeoAnalysisStatisticsEnum, _
    ByVal nbrhood As IRasterNeighborhood, _
    ByVal ignoreNoData As Boolean _
) As IGeoDataset
[C#]
public IGeoDataset FocalStatistics (
    IGeoDataset geoDataset,
    esriGeoAnalysisStatisticsEnum Type,
    IRasterNeighborhood nbrhood,
    bool ignoreNoData
);
[C++]
HRESULT FocalStatistics(
  IGeoDataset* geoDataset,
  esriGeoAnalysisStatisticsEnum Type,
  IRasterNeighborhood* nbrhood,
  VARIANT_BOOL ignoreNoData,
  IGeoDataset** outGeodataset
);
[C++]

Parameters geoDataset [in]
geoDataset is a parameter of type IGeoDataset Type [in]
Type is a parameter of type esriGeoAnalysisStatisticsEnum nbrhood [in]
nbrhood is a parameter of type IRasterNeighborhood ignoreNoData [in] ignoreNoData is a parameter of type VARIANT_BOOL outGeodataset [out, retval]
outGeodataset is a parameter of type IGeoDataset

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Spatial Analyst Extension.

Remarks

geoDataset an input Raster, RasterDataset, RasterBand, or RasterDescriptor that identifies the values of the focal or processing cell and the values of the cells in its specified neighborhood
type an esriGeoAnalysisStatisticsEnum defining the focal statistic to calculate within each neighborhood

The enumeration types are:

esriGeoAnalysisStatsMajority                Majority
esriGeoAnalysisStatsMaximum             Maximum                 
esriGeoAnalysisStatsMean                Mean
esriGeoAnalysisStatsMedian              Median
esriGeoAnalysisStatsMinimum             Minimum
esriGeoAnalysisStatsMinority            Minority
esriGeoAnalysisStatsRange               Range
esriGeoAnalysisStatsStd                 Standard Deviation
EsriGeoAnalysisStatsSum                 Sum                             
esriGeoAnalysisStatsVariety             Variety
nbrhood an RasterNeighborhood defining the configuration of the neighborhoods within which the focal statistics will be calculated

INeighborhoodOp::FocalStatistics supports any neighborhood supported by IRasterNeighborhood. They include a rectangle, circle, annulus, wedge, and an irregular shaped neighborhood. The neighborhood will be defined by the minimum-bounding rectangle of the specified neighborhood. The minimum-bounding rectangle will include more cells than the specified neighborhood in certain cases such as with a circle, annulus, and wedge.

ignoreNoData a Boolean defining the manner in which NoData values within a neighborhood will influence the output results

If True, then if a NoData value exists within the neighborhood of the processing cell, then the NoData value will be ignored. Only cells within the neighborhood that have data values will be used in determining the statistic.

If False, then if any cell in a neighborhood has a value of NoData, then the output for the processing cell of the neighborhood will be NoData. When False, the presence of a NoData value implies that there is insufficient information to determine the statistic of the values of the neighborhood.

 

See Also

INeighborhoodOp Interface