ArcGIS Enterprise SDK
IRelationalOperator.Within Method
ArcGIS Developer Help

IRelationalOperator.Within Method

Indicates if this geometry is contained (is within) another geometry.

[Visual Basic .NET]
Public Function Within ( _
    ByVal other As IGeometry _
) As Boolean
public bool Within (
    IGeometry other


The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty.  Within is a Clementini operator. Within is the opposite operator of contains.


Only geometries that support the IRelationalOperator interface can be used as input geometries.

If geometry1 is Within geometry2, then geometry2 Contains geometry1.

An empty geometry is within another geometry, unless the other geometry is empty.

Within examples. Only "true" relationships are showed in this picture.

See Also

IRelationalOperator Interface