UpdateMsByMs Method (IGeometryEngine)
Updates M-values along the shortest path between the specified vertices. The interpolation ratio is determined by
the existing M-values along that path and the input M-values.
Parameters
- polyline
- The input polyline.
- fromPartIndex
- The index of the part from which to start.
- fromPointIndex
- The index of the point (relative to the part) from which to start.
- toPartIndex
- The index of the part from which to end.
- toPointIndex
- The index of the point (relative to the part) from which to end.
- fromM
- The start M-value.
- toM
- The end M-value.
- updateMMethod
- The method to use when updating M-values. You can use a combination of update methods by using the bitwise OR operator. For example, to interpolate between the input points and to extrapolate before the input points, useUpdateMMethod.Interpolate | UpdateMMethod.ExtrapolateBefore.
Return Value
A polyline with updated M-values. If the input polyline is empty, then it is returned unchanged.
Update M-values with the interpolation ratio determined by existing M-values and the input M-values - UpdateMsByMs
string json = "{\"hasM\":true,\"paths\":[[[-8,2,1],[-8,5,8],[-5,5,0],[-5,7,12]]],\"spatialReference\":{\"wkid\":4326}}";
Polyline polyline = PolylineBuilderEx.FromJson(json);
Polyline outputPolyline = GeometryEngine.Instance.UpdateMsByMs(polyline, 0, 1, 0, 3, -2, 14, UpdateMMethod.Interpolate);
// The xy-coordinates don't change.
// The M-values of the vertices in outputPolyline are (x, y, m): { 1, -2, 30, 14 }
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.3 or higher.