ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / GetMMonotonic Method
The multipart to check for monotonicity.
Example

In This Topic
    GetMMonotonic Method (GeometryEngine)
    In This Topic
    Determines whether Ms are monotonic, and if so, whether they are ascending or descending.
    Syntax
    public MonotonicType GetMMonotonic( 
       Multipart multipart
    )
    Public Function GetMMonotonic( _
       ByVal multipart As Multipart _
    ) As MonotonicType

    Parameters

    multipart
    The multipart to check for monotonicity.

    Return Value

    MonotonicType indicating whether or not the Ms are monotonic as well as whether they are ascending or descending.
    Exceptions
    ExceptionDescription
    Multipart is null.
    The geometry is not M-Aware.
    Remarks
    The Ms are ascending if the Ms are ordered such that M1 < M2 < M3 < . . . < Mn. The Ms are descending if the Ms are ordered such that M1 > M2 > M3 > . . . > Mn
    Example
    Determine whether Ms are monotonic and whether ascending or descending - GetMMonotonic
    string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,15],[-1000,-2000,20]]]}";
    Polyline polyline = PolylineBuilderEx.FromJson(json);
    
    MonotonicType monotonic = GeometryEngine.Instance.GetMMonotonic(polyline);
    // monotonic = Monotonic.Ascending
    
    json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,5],[-1000,-2000,0]]]}";
    polyline = PolylineBuilderEx.FromJson(json);
    
    monotonic = GeometryEngine.Instance.GetMMonotonic(polyline);
    // monotonic = Monotonic.Descending
    
    json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,15],[-1000,-2000,0]]]}";
    polyline = PolylineBuilderEx.FromJson(json);
    
    monotonic = GeometryEngine.Instance.GetMMonotonic(polyline);
    // monotonic = Monotonic.NotMonotonic
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also