ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / ExtrapolateMs Method
The multipart to copy and update.
The method to use when extrapolating the M-values. For example, if set to ExtrapolateMMethod.ExtrapolateBefore, then only the points before the start point of the range will be updated.
The index of the part which contains the start point of the extrapolate range.
The index of the start point of the extrapolate range. The index is relative to the start part.
The index of the part which contains the end point of the extrapolate range.
The index of the end point of the extrapolate range. The index is relative to the end part.
Example Version

ExtrapolateMs Method (GeometryEngine)
Extrapolates the M-values based on the extrapolate range defined by the input indices.
Syntax

Parameters

multipart
The multipart to copy and update.
extrapolateMethod
The method to use when extrapolating the M-values. For example, if set to ExtrapolateMMethod.ExtrapolateBefore, then only the points before the start point of the range will be updated.
startPartIndex
The index of the part which contains the start point of the extrapolate range.
startPointIndex
The index of the start point of the extrapolate range. The index is relative to the start part.
endPartIndex
The index of the part which contains the end point of the extrapolate range.
endPointIndex
The index of the end point of the extrapolate range. The index is relative to the end part.

Return Value

An updated version of the input multipart.
Exceptions
ExceptionDescription
The input multipart is null.
The HasM property of the input multipart is set to false.
Spatial reference of multipartis an image coordinate system.
startPartIndex or startPointIndex or endPartIndex or endPointIndex is negative.
endPartIndex is less than startPartIndex.
The extrapolation range is invalid.
startPartIndex or endPartIndex is greater than or equal to the number of parts in the multipart.
startPointIndex or endPointIndex is greater than or equal to the number of points in the specified part.
Example
Extrapolate M-values based on a range defined by part and vertex indices - ExtrapolateMs
string json = "{\"hasM\":true,\"paths\":[[[2,0,50],[2,1,40],[3,1,30],[3,5,60],[7,5,12],[7,1,20],[9,1,28],[9,3,10]]],\"spatialReference\":{\"wkid\":4326}}";
Polyline polyline = PolylineBuilderEx.FromJson(json);

// Extrapolate M-values from part 0, point 3 to part 0, point 5
Polyline outPolyline = GeometryEngine.Instance.ExtrapolateMs(polyline, ExtrapolateMMethod.ExtrapolateBefore, 0, 3, 0, 5) as Polyline;
// The points in outPolyline are (x, y, m):
// ( 2, 0, 90 ), ( 2, 1, 85 ), ( 3, 1, 80 ), ( 3, 5, 60 ), ( 7, 5, 12 ), ( 7, 1, 20 ), ( 9, 1, 28 ), ( 9, 3, 10 )

json = "{\"hasM\":true,\"paths\":[[[2,0,50],[2,1,40],[3,1,30],[3,5,60],[7,5,12],[7,1,20],[9,1,28],[9,3,10]],[[5,-4,-10],[5,-2,-40],[10,-2,-60],[10,-6,-50],[8,-6,-40],[8,-4,-80],[6,-4,-90]]],\"spatialReference\":{\"wkid\":4326}}";
polyline = PolylineBuilderEx.FromJson(json);

// Extrapolate M-values from part 0, point 5 to part1, point 1
outPolyline = GeometryEngine.Instance.ExtrapolateMs(polyline, ExtrapolateMMethod.ExtrapolateAfter, 0, 5, 1, 1) as Polyline;
// The points in part 0 of outPolyline don't change. They are (x, y, m):
// ( 2, 0, 50 ), ( 2, 1, 40 ), ( 3, 1, 30 ), ( 3, 5, 60 ), ( 7, 5, 12 ), ( 7, 1, 20 ), ( 9, 1, 28 ), ( 9, 3, 10 )

// The points in part 1 of outPolyline are (x, y, m):
// ( 5, -4, -10 ), ( 5, -2, -40 ), ( 10, -2, -90 ), ( 10, -6, -130 ), ( 8, -6, -150 ), ( 8, -4, -170 ), ( 6, -4, -190 )
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.3 or higher.
See Also