ArcGIS Explorer Component Help |
Unit..::.Convert Method (Double, Unit, Unit) |
Unit Class See Also |
Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static double Convert( double inMeasurement, Unit inUnit, Unit outUnit ) |
Visual Basic (Declaration) |
---|
Public Shared Function Convert ( _ inMeasurement As Double, _ inUnit As Unit, _ outUnit As Unit _ ) As Double |
Parameters
- inMeasurement
- Type: System..::.Double
The measurement to convert.
- inUnit
- Type: ESRI.ArcGISExplorer.Geometry..::.Unit
The Units of the inMeasurement.
- outUnit
- Type: ESRI.ArcGISExplorer.Geometry..::.Unit
The Units that inMeasurement should be converted to.
Return Value
The measurement converted to be in outUnit units.Remarks
This method can be used to convert a measurement in one unit to another unit of the same UnitType; for example, a distance in Meters can be converted into a distance in Feet.
Bear in mind that converting a measurement between different UnitTypes is not possible, as noted in the exception section. This includes the case of converting between angular units and linear units - the reason for this limitation is that angular units may change in terms of the linear distance they represent depending on where they are located on the earth. If you wish to convert from an angular to a linear measurement, then you can use the GeodesicUtilities.Length method to specify a particular Polyline (which specifies the location on the earth) to return a measurement in linear units. Similarly you can use the GeodesicUtilities.Area methods to convert the area of a specific Polygon or Envelope from an angular to an area unit.
Exceptions
Exception | Condition |
---|---|
ESRI.ArcGISExplorer..::.ExplorerException | Converting a measurement between different types of Unit is not possible; for example you cannot convert from a linear measurement of Yards to an area measurement of square yards. |