Parameters
- multipart
- The multipart from which the M values are extracted.
- minM
- The minimum M value.
- maxM
- The maximum M value.
Exception | Description |
---|---|
System.ArgumentNullException | Multipart is null or empty. |
System.InvalidOperationException | This geometry is not M-Aware. |
System.NotImplementedException | Spatial reference of multipartis an image coordinate system. |
string json = "{\"hasM\":true,\"rings\":[[[-3000,-2000,10],[-2000,-2000,15],[-1000,-2000,20],[0,-2000,0],[1000,-2000,-20],[2000,-2000,-30],[3000,-2000,10],[4000,-2000,5]]],\"spatialReference\":{\"wkid\":3857}}"; Polygon polygon = PolygonBuilder.FromJson(json); double minM, maxM; GeometryEngine.Instance.GetMinMaxM(polygon, out minM, out maxM); // minM = -30 // maxM = 20 json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,null],[-1000,-2000,null]]]}"; Polyline polyline = PolylineBuilder.FromJson(json); GeometryEngine.Instance.GetMinMaxM(polyline, out minM, out maxM); // minM = 10 // maxM = 10 json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,null],[-2000,-2000,null],[-1000,-2000,null]]]}"; polyline = PolylineBuilder.FromJson(json); GeometryEngine.Instance.GetMinMaxM(polyline, out minM, out maxM); // minM = double.Nan // maxM = double.Nan
Target Platforms: Windows 10, Windows 8.1