Class Unit
Defines a base class for units of measurement.
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public abstract class Unit
Remarks
The unit abstract class is a base class for measurement classes such as LinearUnit, AngularUnit, and AreaUnit. Many function parameters only accept specific types of measurement to reduce the chance of accidental use of inappropriate values, but some generic functions accept all unit types, such as for translation from ID to text description.
LinearUnit - Projected coordinate systems define coordinates using linear measurements, for example using meters or miles. They, are also used to return distance measurements, for example by some members of GeometryEngine.
AngularUnit - Geographic coordinate systems define coordinates using angular measurements, for example using degrees or radians.
AreaUnit - Projected coordinate systems define area units for two dimensional measurements such as the area enclosed by a ring, for example in acres or square kilometers.
Linear, angular, and area units can be defined by using enumerations of the most common units of measurement. They can also be defined by well-known ID (WKID) or well-known text (WKText). Create the unit instances using the Unit base class or the subtype, passing in the enumeration for a specific unit of measurement.
Construction of related units are also supported so that if, for instance, the linear unit (e.g. METERS) is known, then the corresponding area unit (e.g. SQUARE_METERS) can be created based on the linear unit.
Custom Unit implementations are not supported.
Each instance of the various units types has properties for the unit name (singular, plural, and abbreviated) and provides methods for unit conversion between different units of measurement in the same category of measurement.
All unit names and abbreviations are returned in the English language. Instances of unit are immutable.
Properties
Name | Description |
---|---|
Abbreviation | Gets the abbreviation of the unit. |
DisplayName | Gets the display name of the unit. |
Name | Gets the name of the unit. |
PluralDisplayName | Gets the display name of the unit. |
UnitType | Gets the type of unit. |
Wkid | Gets the well-known ID for the unit, or 0 for a custom unit. |
Methods
Name | Description |
---|---|
FromWkid(Int32) | Creates a unit given its well-known ID. |
IsEqual(Unit) | Returns true of the Unit instances are the same. |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.0 - 200.6 |
Xamarin.Android | 100.0 - 100.15 |
Xamarin.iOS | 100.0 - 100.15 |
UWP | 100.0 - 200.6 |