Unit class final

Defines a unit of measurement.

Unit 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 LinearUnit (e.g. METERS) is known, then the corresponding AreaUnit (e.g. SQUARE_METERS) can be created based on the LinearUnit.

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.

Implemented types
Implementers

Properties

abbreviation String
The abbreviation of the unit.
no setter
displayName String
The display name of the unit.
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
The name of the unit.
no setter
pluralDisplayName String
The display name of the unit.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
wkid int
The well-known ID for the unit, or 0 for a custom unit.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromWkid(int wkid) Unit
Creates a unit given its well-known ID.