Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public sealed class Unit |
Visual Basic (Declaration) |
---|
Public NotInheritable Class Unit |
Remarks
Each instance of the Unit class represents a specific unit of measurement, and measure either linear, angular, or area values. Projected coordinate systems use linear units, and geographical coordinate systems use angular units; area units are used in various methods, for example Unit.Convert and GeodesicUtilities.Area. The UnitType property indicates which type of measurement units are represented by a Unit object.
The units of measurement used by a CoordinateSystem are accessible via the CoordinateSystem.Unit property; you can navigate down to the units of a Map, Layer, Column or Geometry as they all have a CoordinateSystem property.
Units are often retrieved from the CoordinateSystem of the appropriate one of these objects; however you can create new Unit objects by using either of the following methods:
- By browsing to the Unit class using intellisense, and using the nested type initializers for Unit..::.Linear, Unit..::.Angular, and Unit..::.Area units.
- By unit identifier, using the Unit(Int32) constructor.
Examples
// Find out the Units used in a CoordinateSystem. CoordinateSystem bng = CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.Europe.BritishNationalGrid; string message = "The coordinate system " + bng.Name + " uses the units " + bng.Unit.GetPluralName(UnitNameOptions.Detailed);
' Find out the Units used in a CoordinateSystem. Dim bng As CoordinateSystem = CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.Europe.BritishNationalGrid Dim message As String = "The coordinate system " & bng.Name & _ " uses the units " & bng.Unit.GetPluralName(UnitNameOptions.Detailed)