ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / CalculateNonSimpleMs Method
The multipart to calculate M-values for.
The value to which NaN M-values that could not be interpolated will be set.

In This Topic
    CalculateNonSimpleMs Method (GeometryEngine)
    In This Topic
    Calculates M attribute values for each non-simple (NaN) M-value from existing simple (non-NaN) M attributes on the specified geometry. The non-simple M-values are obtained by extrapolation/interpolation for polylines and interpolation for polygons.
    public Multipart CalculateNonSimpleMs( 
       Multipart multipart,
       double defaultMValue
    Public Function CalculateNonSimpleMs( _
       ByVal multipart As Multipart, _
       ByVal defaultMValue As Double _
    ) As Multipart


    The multipart to calculate M-values for.
    The value to which NaN M-values that could not be interpolated will be set.

    Return Value

    A geometry in which each coordinate has a simple (non-NaN) M-value.
    Multipart is null or empty.
    This geometry is not M-Aware.
    Interpolate M values on a polygon
    List<MapPoint> coords = new List<MapPoint>()
      MapPointBuilderEx.CreateMapPoint(0, 0, 0, 0),
      MapPointBuilderEx.CreateMapPoint(0, 1000),
      MapPointBuilderEx.CreateMapPoint(1000, 1000, 10, 50)
    SpatialReference sr = SpatialReferences.WebMercator;
    Polygon polygon = PolygonBuilderEx.CreatePolygon(coords, sr);
    // polygon.HasM = true
    // polygon.Points[1].HasM = true
    // polygon.Points[1].M = NaN
    Polygon polygonNoNaNMs = GeometryEngine.Instance.CalculateNonSimpleMs(polygon, 0) as Polygon;
    // polygonNoNaNMs.Points[1].HasM = true
    // polygonNoNaNMs.Points[1].M = 25  (halfway between 0 and 50)

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also