Parameters
- multipart
- The multipart on which to set the M-values.
- fromM
- The beginning M-value.
- toM
- The end M-value.
Return Value
The multipart with new M-values. If the input multipart is empty, then it is returned unchanged.
Exception | Description |
---|---|
System.ArgumentNullException | Multipart is null. |
System.InvalidOperationException | This geometry is not M-Aware. |
ArcGIS.Core.Geometry.Exceptions.InvalidParameterException | The input fromM and toM are invalid and M-values cannot be interpolated. |
System.NotImplementedException | Spatial reference of multipartis an image coordinate system. |
string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000],[-2000,-2000],[-1000,-2000],[0,-2000],[1000,-2000],[2000,-2000],[3000,-2000],[4000,-2000]]],\"spatialReference\":{\"wkid\":3857}}"; Polyline polyline = PolylineBuilderEx.FromJson(json); Polyline outPolyline = GeometryEngine.Instance.SetAndInterpolateMsBetween(polyline, 100, 800) as Polyline; ReadOnlyPointCollection outPoints = outPolyline.Points; // outPoints M values are { 100, 200, 300, 400, 500, 600, 700, 800 };
Target Platforms: Windows 11, Windows 10