ArcObjects Library Reference (SpatialAnalyst)  

INeighborhoodOp.BlockStatistics Method

Calculates statistics for a non-overlapping neighborhood.

[Visual Basic .NET]
Public Function BlockStatistics ( _
    ByVal geoDataset As IGeoDataset, _
    ByVal Type As esriGeoAnalysisStatisticsEnum, _
    ByVal nbrhood As IRasterNeighborhood, _
    ByVal ignoreNoData As Boolean _
) As IGeoDataset
[C#]
public IGeoDataset BlockStatistics (
    IGeoDataset geoDataset,
    esriGeoAnalysisStatisticsEnum Type,
    IRasterNeighborhood nbrhood,
    bool ignoreNoData
);
[C++]
HRESULT BlockStatistics(
  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 integer or floating-point Raster, RasterDataset, RasterBand, or RasterDescriptor that identifies the values of the cells in a specified neighborhood

If no neighborhood is specified, the default neighborhood is a 3-x 3-rectangle.

type an esriGeoAnalysisStatisticsEnum defining the block statitistic to calculate within each block

The enumeration types are:

esriGeoAnalysisStatsMajority for the majority value, esriGeoAnalysisStatsMaximum for the maximum value, esriGeoAnalysisStatsMean for the mean, esriGeoAnalysisStatsMedian for the median, esriGeoAnalysisStatsMinimum for the minimum value, esriGeoAnalysisStatsMinority for the minority value, esriGeoAnalysisStatsRange for the range of values, esriGeoAnalysisStatsStd for the standard deviation, esriGeoAnalysisStatsSum for the sum of the values, or esriGeoAnalysisStatsVariety for the variety of the values.

nbrhood an IRasterNeighborhood defining the configuration of the blocks within which the block statistics will be calculated

INeighborhood::BlockStatistics supports any neighborhood supported by IRasterNeighborhood. They include a rectangle, circle, annulus, wedge, and an irregular shaped neighborhood. The block will be defined by the minimum-bounding rectangle of the specified neighborhood. The minimum-bounding rectangle will include more cells then 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 a neighborhood, then the NoData value will be ignored. Only cells within the neighborhood that have data values will be used in determining the statistics of the values.

If False, then if any cell in a neighborhood has a value of NoData, then the output for each cell in the corresponding block will receive NoData. When the Boolean is False, the presence of a NoData value implies that there is insufficient information to determine the statistics of the values of the neighborhood.

 

See Also

INeighborhoodOp Interface

.NET Snippets

Create NeighborhoodOp Block Statistics Raster |