ArcGIS Enterprise SDK
IRelationalOperator.Contains Method
ArcGIS Developer Help

IRelationalOperator.Contains Method

Indicates if this geometry contains the other geometry.

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


The base geometry contains the comparison geometry (other) if the comparison geometry is a subset of the base geometry and the intersection of their interiors is not empty. Therefore a polygon does not contain any part of its 1D boundary. Contains is the opposite operator of Within.


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

If geometry1 Contains geometry2, then geometry2 is Within geometry1.

An empty geometry does not contain another geometry.  On the other hand, an empty geometry is contained in another geometry, unless the other geometry is empty.

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

See Also

IRelationalOperator Interface