// clip a polyline by a polygon List<Coordinate2D> list = new List<Coordinate2D>(); list.Add(new Coordinate2D(1.0, 1.0)); list.Add(new Coordinate2D(1.0, 4.0)); list.Add(new Coordinate2D(4.0, 4.0)); list.Add(new Coordinate2D(4.0, 1.0)); Polygon polygon = PolygonBuilderEx.CreatePolygon(list, SpatialReferences.WGS84); LineSegment crossingLine = LineBuilderEx.CreateLineSegment(MapPointBuilderEx.CreateMapPoint(0, 3), MapPointBuilderEx.CreateMapPoint(5.0, 3.0)); Polyline p = PolylineBuilderEx.CreatePolyline(crossingLine); Geometry geometry = GeometryEngine.Instance.Clip(p, polygon.Extent);
Target Platforms: Windows 11, Windows 10