CalculateNonSimpleMs Method (IGeometryEngine)
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.
Parameters
- multipart
- The multipart to calculate M-values for.
- defaultMValue
- 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.
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.