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

In This Topic
    SpatialReferenceBuilder Constructor(Int32,String)
    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,
       string vcsWkt
    )
    Public Function New( _
       ByVal wkid As Integer, _
       ByVal vcsWkt As String _
    )

    Parameters

    wkid
    The well-known ID that represents the Spatial Reference.
    vcsWkt
    The well-known text that represents the vertical coordinate system.
    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 a string
    // Use a builder convenience method or use a builder constructor.
    
    // custom VCS - use vertical shift of -1.23 instead of 0
    string custom_vWkt = @"VERTCS[""SHD_height"",VDATUM[""Singapore_Height_Datum""],PARAMETER[""Vertical_Shift"",-1.23],PARAMETER[""Direction"",-1.0],UNIT[""Meter"",1.0]]";
    
    // Builder convenience methods don't need to run on the MCT.
    SpatialReference sr4326_customVertical = SpatialReferenceBuilder.CreateSpatialReference(4326, custom_vWkt);
    // SpatialReferenceBuilder properties
    //   sr4326_customVertical.wkid == 4326
    //   sr4326_customVertical.vert_wkid == 0
    //   sr4326_customVertical.vert_wkt == custom_vWkt
    //   sr4326_customVertical.hasVcs == true
    
    // SpatialReferenceBuilder constructors need to run on the MCT.
    ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
    {
      using (SpatialReferenceBuilder sb = new SpatialReferenceBuilder(4326, custom_vWkt))
      {
        // do something with the builder
    
        sr4326_customVertical = sb.ToSpatialReference();
      }
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also