This document is archived and information here might be outdated.  Recommended version.


IGeometryServer.FindUnitsByWKT Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Geometry)  

IGeometryServer.FindUnitsByWKT Method

Defines a unit object based upon its well known text string.

[Visual Basic .NET]
Public Function FindUnitsByWKT ( _
    ByVal WKT As String _
) As IUnit
[C#]
public IUnit FindUnitsByWKT (
    string WKT
);
[C++]
HRESULT FindUnitsByWKT(
  BSTR WKT,
  IUnit** ppU
);
[C++]

Parameters WKT WKT is a parameter of type BSTR ppU [out, retval]
ppU is a parameter of type IUnit

Product Availability

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

Remarks

Finds a predefined linear or angular unit of measure based on its well known text string (WKT). The Unit returned is often used in other Geometry service methods such as Buffer. 

Here are some examples of WKT strings for linear and angular units.

U.S. Survey Foot:

UNIT["Foot_US",0.3048006096012192,AUTHORITY["EPSG",9003]]

Arc-minute:

UNIT["Minute",0.0002908882086657216,AUTHORITY["EPSG",9103]]

Creating custom units

You can create a custom unit in ArcObjects by using the ImportFromESRISpatialReference method on an existing linear or angular unit object. Web service clients can do this by creating a LinearUnit or AngularUnit value first and then assigning the WKT string to the WKT property of the value. The example script in this topic illustrates the former approach and the example provided in the IGeometryServer topic illustrates the latter.

See Also

IGeometryServer Interface