ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / ReadOnlyPointCollection Class / Item Property
The zero-based index of the element to get or set.
Example

In This Topic
    Item Property (ReadOnlyPointCollection)
    In This Topic
    Gets the element at the specified index.
    Syntax
    Public ReadOnly Default Property Item( _
       ByVal index As Integer _
    ) As MapPoint
    public MapPoint this[ 
       int index
    ]; {get;}

    Parameters

    index
    The zero-based index of the element to get or set.

    Property Value

    The element at the specified index.
    Exceptions
    ExceptionDescription
    index is less than 0 or index is equal to or greater than Count.
    Example
    Polygon contains MapPoints, Polylines, Polygons
    {
        // build a polygon      
        List<MapPoint> pts =
        [
          MapPointBuilderEx.CreateMapPoint(1.0, 1.0),
      MapPointBuilderEx.CreateMapPoint(1.0, 2.0),
      MapPointBuilderEx.CreateMapPoint(2.0, 2.0),
      MapPointBuilderEx.CreateMapPoint(2.0, 1.0),
    ];
    
        Polygon poly = PolygonBuilderEx.CreatePolygon(pts);
    
        // test if an inner point is contained
        MapPoint innerPt = MapPointBuilderEx.CreateMapPoint(1.5, 1.5);
        bool contains = GeometryEngine.Instance.Contains(poly, innerPt);   // contains = true
    
        // test a point on a boundary
        contains = GeometryEngine.Instance.Contains(poly, poly.Points[0]);     // contains = false
    
        // test an interior line
        MapPoint innerPt2 = MapPointBuilderEx.CreateMapPoint(1.25, 1.75);
        List<MapPoint> innerLinePts = [innerPt, innerPt2];
    
        // test an inner polyline
        polyline = PolylineBuilderEx.CreatePolyline(innerLinePts);
        contains = GeometryEngine.Instance.Contains(poly, polyline);   // contains = true
    
        // test a line that crosses the boundary
        MapPoint outerPt = MapPointBuilderEx.CreateMapPoint(3, 1.5);
        List<MapPoint> crossingLinePts = [innerPt, outerPt];
    
        polyline = PolylineBuilderEx.CreatePolyline(crossingLinePts);
        contains = GeometryEngine.Instance.Contains(poly, polyline);     // contains = false
    
        // test a polygon in polygon
        Envelope env = EnvelopeBuilderEx.CreateEnvelope(innerPt, innerPt2);
        contains = GeometryEngine.Instance.Contains(poly, env);      // contains = true
      }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also