ArcGIS Pro NearestVertex和NearestPoint

ArcGIS Pro NearestVertex和NearestPoint
   SpatialReference sr = SpatialReferences.WGS84;
            MapPoint pt = MapPointBuilder.CreateMapPoint(10, -4.1, sr);

            List<Coordinate2D> coords = new List<Coordinate2D>()
            {
              new Coordinate2D(10, 1),
               new Coordinate2D(10, -4),
               new Coordinate2D(0, -4),
               new Coordinate2D(0, 1),
                 new Coordinate2D(10, 1)
            };

            Polygon polygon = PolygonBuilder.CreatePolygon(coords, sr);

            // find the nearest point in the polygon geomtry to the pt
            ProximityResult result = GeometryEngine.Instance.NearestPoint(polygon, pt);
            // result.Point = 5, 1
            // result.SegmentIndex = 3
            // result.PartIndex = 0
            // result.PointIndex = null
            //result.Distance = 4
            //result.RightSide = false

            // find the nearest vertex in the polgyon geometry to the pt
            result = GeometryEngine.Instance.NearestVertex(polygon, pt);
            // result.Point = 10, 1
            // result.PointIndex = 0
            // result.SegmentIndex = null
            // result.PartIndex = 0
            // result.Distance = Math.Sqrt(41)
            // result.RightSide = false