ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / MapPointBuilderEx Class / CreateMapPoint Method / CreateMapPoint(Double,Double,Double,Double,SpatialReference) Method
X coordinate.
Y coordinate.
Z coordinate. HasZ is set to true.
Measure value. HasM is set to true.
(Optional) The SpatialReference. The default value is null.
Example

CreateMapPoint(Double,Double,Double,Double,SpatialReference) Method
Convenience method to create a MapPoint instance with the given X, Y, Z and M coordinates. The HasZ and HasM properties on this instance are set to true.
Syntax
public static MapPoint CreateMapPoint( 
   double x,
   double y,
   double z,
   double m,
   SpatialReference spatialReference
)

Parameters

x
X coordinate.
y
Y coordinate.
z
Z coordinate. HasZ is set to true.
m
Measure value. HasM is set to true.
spatialReference
(Optional) The SpatialReference. The default value is null.

Return Value

Example
Construct a MapPoint
// Use a builder convenience method or use a builder constructor.

// create a 3d point with M
MapPoint pt = MapPointBuilderEx.CreateMapPoint(1.0, 2.0, 3.0, 4.0);


// builderEx constructors don't need to run on the MCT.
MapPointBuilderEx mb = new MapPointBuilderEx(1.0, 2.0, 3.0, 4.0);
// do something with the builder

MapPoint ptWithM = mb.ToGeometry();


MapPoint clone = ptWithM.Clone() as MapPoint;
MapPoint anotherM = MapPointBuilderEx.CreateMapPoint(ptWithM);


MapPointBuilderEx builderEx = new MapPointBuilderEx(1.0, 2.0, 3.0);
builderEx.HasM = true;
builderEx.M = 4.0;

pt = builderEx.ToGeometry() as MapPoint;


// or another alternative with builderEx constructor
builderEx = new MapPointBuilderEx(1.0, 2.0, true, 3.0, true, 4.0, false, 0);
pt = builderEx.ToGeometry() as MapPoint;


// or use a builderEx convenience method
pt = MapPointBuilderEx.CreateMapPoint(1.0, 2.0, 3.0, 4.0);
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

ArcGIS Pro version: 2.8 or higher.
See Also