This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryServer Interface > IGeometryServer.FindUnitsByWKT Method (ArcObjects .NET 10.5 SDK) |
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
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.