Show / Hide Table of Contents

Class Unit

Defines a base class for units of measurement.

Inheritance
Object
Unit
AngularUnit
AreaUnit
LinearUnit
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public abstract class Unit
Remarks

The unit abstract class provides a common base class between all units (linear, area, and angular) for different types of measurement used throughout ArcGIS Maps SDK for .NET. 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 e.g. 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

SpatialReference

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0
In This Article
Back to top Copyright © 2022 Esri.