ArcObjects Library Reference (Geometry)  

IGeometryServer.FindSRByWKT Method

Defines a spatial reference object based upon its well known text string (WKT) and optionally a WKT for a vertical datum. The resolution and xy tolerances are either computed from the sr horizon or set to defaults. The output sr is always high precision.

[Visual Basic .NET]
Public Function FindSRByWKT ( _
    ByVal WKT As String, _
    ByVal WKT_Z As String, _
    ByVal bDefaultXYResolution As Boolean, _
    ByVal bDefaultXYTolerance As Boolean _
) As ISpatialReference
[C#]
public ISpatialReference FindSRByWKT (
    string WKT,
    string WKT_Z,
    bool bDefaultXYResolution,
    bool bDefaultXYTolerance
);
[C++]
HRESULT FindSRByWKT(
  BSTR WKT,
  BSTR WKT_Z,
  VARIANT_BOOL bDefaultXYResolution,
  VARIANT_BOOL bDefaultXYTolerance,
  ISpatialReference** ppSR
);
[C++]

Parameters

WKT   WKT is a parameter of type BSTR WKT_Z   WKT_Z is a parameter of type BSTR bDefaultXYResolution   bDefaultXYResolution is a parameter of type VARIANT_BOOL bDefaultXYTolerance   bDefaultXYTolerance is a parameter of type VARIANT_BOOL ppSR [out, retval]

  ppSR is a parameter of type ISpatialReference

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

Finds a predefined spatial reference based on its OGC/EPSG definition string, otherwise known as its well-known text string (WKT).   The text string contains individual parameters of a spatial reference.  A valid spatial reference for a geographic coordinate system (GEOGCS) may appears as follows:

GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

 

Note the nested structure of parameters includes a datum, spheriod, prime meridian, and angular unit.    

A valid spatial reference for a projected coordinate system (PROJCS) may appears as follows:


PROJCS["World_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]], PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]]


Note the nested structure of parameters includes a geographic coordinate system (GEOGCS), a projection, and a set of projection parameters such as false easting, false northing, and standard parallel.  

If WKT_Z is specified and not empty, then a vertical coordinate system will be created and associated with the horizontal coordinate system.  The definition string can be generated from ArcObjects using the ExportToESRISpatialReference method on a PCS or GCS. The boolean parameters are as described for FindSRByWKID.

See Also

IGeometryServer Interface