Parameters
- polyline
- The input polyline.
Return Value
The reoriented polyline.
Exception | Description |
---|---|
System.ArgumentNullException | Polyline is null. |
System.InvalidOperationException | This geometry is not M-Aware. |
string json = "{\"hasM\":true,\"paths\":[[[0,0,1],[0,1,0],[1,1,-1],[1,0,-2]]]}"; Polyline polyline = PolylineBuilderEx.FromJson(json); Polyline outputPolyline = GeometryEngine.Instance.OrientByMs(polyline); // The points of outputPolyline are (x, y, m): (1, 0, -2), (1, 1, -1), (0, 1, 0), (0, 0, 1) // M-values of second part is not monotonic, so it won't change. The first part will change. json = "{\"hasM\":true,\"paths\":[[[0,0,1],[0,1,0],[1,1,-1],[1,0,-2]],[[5,4,6],[6,4,5],[8,6,7]]]}"; polyline = PolylineBuilderEx.FromJson(json); outputPolyline = GeometryEngine.Instance.OrientByMs(polyline); // The points of part 0 of outputPolyline are (x, y, m): (1, 0, -2), (1, 1, -1), (0, 1, 0), (0, 0, 1) // The points of part 1 of outputPolyline are (x, y, m): (5, 4, 6), (6, 4, 5), (8, 6, 7)
Target Platforms: Windows 11, Windows 10