ArcGIS Pro 2.9 API Reference Guide
CreateSpatialReference(Int32) Method
Example 

ArcGIS.Core.Geometry Namespace > SpatialReferenceBuilder Class > CreateSpatialReference Method : CreateSpatialReference(Int32) Method
The Well-known ID that represents the Spatial Reference.
Convenience method to create a new instance of the SpatialReference class.
Syntax
public static SpatialReference CreateSpatialReference( 
   int wkid
)
Public Overloads Shared Function CreateSpatialReference( _
   ByVal wkid As Integer _
) As SpatialReference

Parameters

wkid
The Well-known ID that represents the Spatial Reference.

Return Value

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

// Builder convenience methods don't need to run on the MCT.
SpatialReference sr3857 = SpatialReferenceBuilder.CreateSpatialReference(3857);

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (SpatialReferenceBuilder srBuilder = new SpatialReferenceBuilder(3857))
  {
    // do something with the builder

    sr3857 = srBuilder.ToSpatialReference();
  }
});
// create the polygon
List<MapPoint> pts = new List<MapPoint>();
pts.Add(MapPointBuilder.CreateMapPoint(1.0, 1.0, SpatialReferences.WGS84));
pts.Add(MapPointBuilder.CreateMapPoint(1.0, 2.0, SpatialReferences.WGS84));
pts.Add(MapPointBuilder.CreateMapPoint(2.0, 2.0, SpatialReferences.WGS84));
pts.Add(MapPointBuilder.CreateMapPoint(2.0, 1.0, SpatialReferences.WGS84));

Polygon polygon = PolygonBuilder.CreatePolygon(pts);
// ensure it is simple
bool isSimple = GeometryEngine.Instance.IsSimpleAsFeature(polygon);

// create the spatial reference to project to
SpatialReference northPole = SpatialReferenceBuilder.CreateSpatialReference(102018);   // north pole stereographic 

// project
Geometry geometry = GeometryEngine.Instance.Project(polygon, northPole);
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

SpatialReferenceBuilder Class
SpatialReferenceBuilder Members
Overload List