Parameters
- multipart
- The multipart from which the subcurve will be extracted.
- fromM
- The M-value in the multipart to start the subcurve.
- toM
- The M-value in the multipart to end the subcurve
Return Value
Polyline representing the subcurve.
Exception | Description |
---|---|
System.ArgumentNullException | Multipart is null or empty. |
System.InvalidOperationException | This geometry is not M-Aware. |
System.NotImplementedException | Spatial reference of multipartis an image coordinate system. |
string json = "{\"hasM\":true,\"paths\":[[[-2000,0,1],[-1000,1000,2],[-1000,0,3],[1000,1000,4],[2000,1000,5],[2000,2000,6],[3000,2000,7],[4000,0,8]]],\"spatialReference\":{\"wkid\":3857}}"; Polyline polyline = PolylineBuilderEx.FromJson(json); Polyline subCurve = GeometryEngine.Instance.GetSubCurveBetweenMs(polyline, 2, 6); // subCurve.PointCount = 5 // subCurve.Points[0] X= --1000, Y= 1000 M= 2 // subCurve.Points[1] X= --1000, Y= 0 M= 3 // subCurve.Points[2] X= 1000, Y= 1000 M= 4 // subCurve.Points[3] X= 2000, Y= -1000 M= 5 // subCurve.Points[4] X= 2000, Y= -2000 M= 6 subCurve = GeometryEngine.Instance.GetSubCurveBetweenMs(polyline, double.NaN, 5); // subCurve.PointCount = 0 // subCurve.IsEmpty = true
Target Platforms: Windows 11, Windows 10, Windows 8.1