string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,5],[-1000,-2000,0]]]}";
Polyline polyline = PolylineBuilderEx.FromJson(json);
Monotonicity monotonicity = GeometryEngine.Instance.GetMMonotonicity(polyline);
// monotonicity = Monotonicity.ValueDecreases
// Create a polygon from the polyline
Polygon 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