ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / SpatialReferenceBuilder Class / SpatialReferenceBuilder Constructor / SpatialReferenceBuilder Constructor(Int32,Int32)
The well-known ID that represents the Spatial Reference.
The vertical coordinate system well-known ID.
Example

In This Topic
    SpatialReferenceBuilder Constructor(Int32,Int32)
    In This Topic
    Creates a new instance of the SpatialReferenceBuilder class. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public SpatialReferenceBuilder( 
       int wkid,
       int vcsWkid
    )
    Public Function New( _
       ByVal wkid As Integer, _
       ByVal vcsWkid As Integer _
    )

    Parameters

    wkid
    The well-known ID that represents the Spatial Reference.
    vcsWkid
    The vertical coordinate system well-known ID.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Construct a SpatialReference with a vertical coordinate system - from well-known IDs
    // Use a builder convenience method or use a builder constructor.
    
    // see a list of vertical coordinate systems at http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Vertical_coordinate_systems/02r3000000rn000000/
    
    // Builder convenience methods don't need to run on the MCT.
    // 4326 = GCS_WGS_1984
    // 115700 = vertical WGS_1984
    SpatialReference sr4326_115700 = SpatialReferenceBuilder.CreateSpatialReference(4326, 115700);
    
    // SpatialReferenceBuilder constructors need to run on the MCT.
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      using (SpatialReferenceBuilder sb = new SpatialReferenceBuilder(4326, 115700))
      {
        // SpatialReferenceBuilder properties
        //   sb.wkid == 4326
        //   sb.Wkt == "GEOGCS["MyGCS84",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT[\"Radian\",1.0]]"
        //   sb.name == GCS_WGS_1984
        //   sb.vcsWkid == 115700
        //   sb.VcsWkt == "VERTCS["WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]
    
        // do something with the builder
    
        sr4326_115700 = sb.ToSpatialReference();
      }
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also