Geometry service FindUnitsByWKID method
The FindUnitsByWKID method defines a unit object based on its OGC/EPSG or ESRI WKID.
FindUnitsByWKID(string Authority, int WKID)
Parameter |
Description |
---|---|
Authority |
Usually "EPSG" or "ESRI", but can also be an arbitrary string. If empty, the default authority will be returned. |
WKID |
Integer that defines a well-known ID (WKID) for a predefined unit. For a list of valid EPSG and ESRI WKID codes, see the discussion Finding a Well-Known ID. |
Return Value
A Unit object. Depending on the type of unit, you can cast to an AngularUnit or LinearUnit.
Remarks
The Unit returned is often used in other Geometry service methods such as Buffer.
Examples
C#
Geometry_GeometryServer geometryService = new Geometry_GeometryServer();
geometryService.Url = "http://localhost:6080/arcgis/services/Geometry/GeometryServer";
// International Meter
LinearUnit linearUnit = (LinearUnit) geometryService.FindUnitsByWKID("EPSG", 9001);
VB.NET
Dim geomeTryService As Geometry_GeometryServer = New Geometry_GeometryServer()
geomeTryService.Url = "http://localhost:6080/arcgis/services/Geometry/GeometryServer"
' International Meter
Dim linearUnit As LinearUnit = CType(geomeTryService.FindUnitsByWKID("EPSG", 9001), LinearUnit)
Java
String serviceURL = "http://localhost:6080/arcgis/services/Geometry/GeometryServer";
GeometryServerBindingStub geometryService = new GeometryServerBindingStub(serviceURL);
//Test FindUnitsByWKID - International Meter
LinearUnit linearUnit = (LinearUnit) geometryService.findUnitsByWKID("EPSG", 9001);
System.out.println("WKT: " + linearUnit.getWKT());
2/28/2020