/// <summary> /// Convert a collection of points into a <see cref="PointCollectionList"/> that can be used as paths in <see cref="Polyline"/> types /// or rings in <see cref="Polygon"/> types /// </summary> /// <param name="points"></param> /// <returns></returns> public static PointCollectionList ToPointCollectionList(this IEnumerable<Point> points) { var result = new PointCollectionList(); var pointCollection = new PointCollection(); foreach (var point in points) pointCollection.Add(point.ToPointCollectionEntry()); result.Add(pointCollection); return result; }
/// <summary> /// Convert a collection of points into a <see cref="PointCollectionList"/> that can be used as paths in <see cref="Polyline"/> types /// or rings in <see cref="Polygon"/> types /// </summary> /// <param name="points"></param> /// <returns></returns> public static PointCollectionList ToPointCollectionList(this IEnumerable <Point> points) { var result = new PointCollectionList(); var pointCollection = new PointCollection(); foreach (var point in points) { pointCollection.Add(point.ToPointCollectionEntry()); } result.Add(pointCollection); return(result); }
private static Esri.ArcGISRuntime.Geometry.Polyline CreatePolyline(PointCollectionList parts, Esri.ArcGISRuntime.Geometry.SpatialReference spatialReference) { var builder = new PolylineBuilder(spatialReference); foreach (var part in parts) { var roadPart = new Part(spatialReference); foreach (var vertex in part) { var point = CreatePoint(vertex, spatialReference); if (!point.IsEmpty) { roadPart.AddPoint(point); } } builder.AddPart(roadPart); } return(builder.ToGeometry()); }