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


IRasterNeighborhood.SetRectangle Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoAnalyst)  

IRasterNeighborhood.SetRectangle Method

Sets a rectangle neighborhood object.

[Visual Basic .NET]
Public Sub SetRectangle ( _
    ByVal width As Double, _
    ByVal height As Double, _
    ByVal unitsType As esriGeoAnalysisUnitsEnum _
)
[C#]
public void SetRectangle (
    double width,
    double height,
    esriGeoAnalysisUnitsEnum unitsType
);
[C++]
HRESULT SetRectangle(
  double width,
  double height,
  esriGeoAnalysisUnitsEnum unitsType
);
[C++]

Parameters width [in] width is a parameter of type double height [in] height is a parameter of type double unitsType [in]
unitsType is a parameter of type esriGeoAnalysisUnitsEnum

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

width

the number of units in the x-direction that the neighborhood will encompass.

height

the number of units in the y-direction that the neighborhood will encompass.

unitsType

An esriGeoAnalysisUnitsEnum defining the type of units to calculate the neighborhood.
The enumeration types are:

esriUnitsMap  - neghbourhood is identified by map units (i.e., meters, feet)
esriUnitsCells - neighbourhood is identified by number of cells

 

Defines the shape of a neighborhood and to be a rectangle. The x,y position for the processing cell within the neighborhood, with respect to the upper-left corner of the neighborhood, is determined by the following equations:

x=(width of the neighborhood + 1)/2
y=(height of the neighborhood + 1)/2

If the input number of cells is even, the x- and y-coordinates are computed using truncation.

For example, in a 5-x-5 cell neighborhood the x- and y-values are 3, 3. In a 4-x-4 neighborhood the x- and y-values are 2, 2. 

 

See Also

IRasterNeighborhood Interface

.NET Snippets

Create NeighborhoodOp Block Statistics Raster

.NET Related Topics

Working with helper objects