ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / GetMMonotonicity Method
The multipart to check for monotonicity.
Example

In This Topic
    GetMMonotonicity Method (IGeometryEngine)
    In This Topic
    Gets a combination of Monotonicity values that describes all trends in the M-values over the length of the multipart.
    Syntax
    Function GetMMonotonicity( _
       ByVal multipart As Multipart _
    ) As Monotonicity
    Monotonicity GetMMonotonicity( 
       Multipart multipart
    )

    Parameters

    multipart
    The multipart to check for monotonicity.

    Return Value

    A combination of Monotonicity values.
    Exceptions
    ExceptionDescription
    Multipart is null.
    The multipart is not M-Aware.
    Remarks
    The Ms are increasing if the Ms are ordered such that M1 < M2 < M3 < . . . < Mn. The Ms are descreasing if the Ms are ordered such that M1 > M2 > M3 > . . . > Mn
    Example
    Get a combination of monotonicity values that describes all trends in the M-values over the length of the multipart - GetMMonotonicity
    {
      string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,5],[-1000,-2000,0]]]}";
      polyline = PolylineBuilderEx.FromJson(json);
      Monotonicity monotonicity = GeometryEngine.Instance.GetMMonotonicity(polyline);
      // monotonicity = Monotonicity.ValueDecreases
    
      // Create a polygon from the polyline
      polygon = PolygonBuilderEx.CreatePolygon(polyline);
      monotonicity = GeometryEngine.Instance.GetMMonotonicity(polygon);
      // monotonicity = ValueIncreases | ValueDecreases
    
      json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,10],[-1000,-2000,10]]]}";
      polyline = PolylineBuilderEx.FromJson(json);
      monotonicity = GeometryEngine.Instance.GetMMonotonicity(polygon);
      // monotonicity = Monotonicity.ValueLevel
    
      json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,null],[-2000,-2000,5],[-1000,-2000,10]]]}";
      polyline = PolylineBuilderEx.FromJson(json);
      monotonicity = GeometryEngine.Instance.GetMMonotonicity(polyline);
      // monotonicity = ValueIncreases | ValueEmpty
    
      // Create an empty polyline
      Polyline emptyPolyline = PolylineBuilderEx.FromJson("{\"hasM\":true,\"paths\":[]}");
      monotonicity = GeometryEngine.Instance.GetMMonotonicity(emptyPolyline);
      // monotonicity = Monotonicity.None
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also