SetMsAsDistance Method (IGeometryEngine)
Sets the M values to the cumulative length from the start of the multipart.
Parameters
- multipart
- The multipart in which to set the M values.
- asRatioOrLength
- Indicates whether the M-values are set as lengths or ratios along the multipart.
Return Value
Multipart with M-values set. If the input multipart is empty, then it is returned unchanged.
Set M values to the cumulative length from the start of the multipart - SetMsAsDistance
string json = "{\"hasM\":true,\"rings\":[[[0,0],[0,3000],[4000,3000],[4000,0],[0,0]]],\"spatialReference\":{\"wkid\":3857}}";
Polygon polygon = PolygonBuilderEx.FromJson(json);
Polygon outPolygon = GeometryEngine.Instance.SetMsAsDistance(polygon, AsRatioOrLength.AsLength) as Polygon;
ReadOnlyPointCollection outPoints = outPolygon.Points;
// outPoints M values are { 0, 3000, 7000, 10000, 14000 };
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.