ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / Overlaps Method
The base geometry.
The comparison geometry.
Example

In This Topic
    Overlaps Method (IGeometryEngine)
    In This Topic
    Returns true if geometry1 and geometry2 overlap.
    Syntax
    Function Overlaps( _
       ByVal geometry1 As Geometry, _
       ByVal geometry2 As Geometry _
    ) As Boolean

    Parameters

    geometry1
    The base geometry.
    geometry2
    The comparison geometry.

    Return Value

    True if if geometry1 and geometry2 overlap.
    Exceptions
    ExceptionDescription
    Either geometry1 or geometry2 or both are null.
    The method is not implemented for GeometryBag.
    Incompatible spatial references between the input geometries.
    Remarks
    Two geometries overlap if the dimension of each is equal to the dimension of their intersection, but the intersection itself is not equal to either one.

    GeometryEngine Overlaps

    Example
    Determine if geometries overlap
    {
      MapPoint pt1 = MapPointBuilderEx.CreateMapPoint(1.5, 1.5);
      MapPoint pt2 = MapPointBuilderEx.CreateMapPoint(1.25, 1.75);
      MapPoint pt3 = MapPointBuilderEx.CreateMapPoint(3, 1.5);
      MapPoint pt4 = MapPointBuilderEx.CreateMapPoint(1.5, 2);
    
      //
      // point and point overlap
      //
      bool overlaps = GeometryEngine.Instance.Overlaps(pt1, pt2);        // overlaps = false
      overlaps = GeometryEngine.Instance.Overlaps(pt1, pt1);             // overlaps = false
                                                                         // Two geometries overlap if the region of their intersection is of the same dimension as the geometries involved and 
                                                                         // is not equivalent to either of the geometries.  
    
      List<MapPoint> pts = [pt1, pt2, pt3];
    
      List<MapPoint> pts2 = [pt2, pt3, pt4];
    
      //
      // pt and line overlap
      //
      polyline = PolylineBuilderEx.CreatePolyline(pts);
      bool isSimple = GeometryEngine.Instance.IsSimpleAsFeature(polyline);         // isSimple = true
      overlaps = GeometryEngine.Instance.Overlaps(polyline, pt1);                  // overlaps = false
    
      //
      // line and line
      //
      Polyline polyline2 = PolylineBuilderEx.CreatePolyline(pts2);
      isSimple = GeometryEngine.Instance.IsSimpleAsFeature(polyline2);             // isSimple = true
      overlaps = GeometryEngine.Instance.Overlaps(polyline, polyline2);            // overlaps = true
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also