ArcObjects Library Reference  (Geometry)    

IRelationalOperator.Contains Method

Indicates if this geometry contains the other geometry.

[Visual Basic 6.0]
Function Contains(
    ByVal other As IGeometry _
) As Boolean
[Visual Basic .NET]
Public Function Contains ( _
    ByVal other As IGeometry _
) As Boolean
[C#]
public bool Contains (
    IGeometry other
);
[Java]
public Boolean contains (
    IGeometry other
)
throws
    IOException,
    AutomationException
[C++]
HRESULT Contains(
  IGeometry* other,
  VARIANT_BOOL* Contains
);
[C++]

Parameters

other

  other is a parameter of type IGeometry

Contains [out, retval]

  Contains is a parameter of type VARIANT_BOOL

Product Availability

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

Description

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.

Remarks

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

If geometry1 Contains geometry2, then geometry2 is Within geometry1.

 

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

See Also

IRelationalOperator Interface

Example

IRelationalOperator_Example

 


Feedback Send feedback on this page