ArcGIS Explorer Component Help |
Unit..::.Linear Class |
Unit Class Members Example See Also |
Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static class Linear |
Visual Basic (Declaration) |
---|
Public NotInheritable Class Linear |
Remarks
The properties on this class return Unit objects which represent all of the standard units of linear measurement used in ArcGIS Explorer.
Those units defined as 'international' refer to units of measurement defined by the International System of Units (SI). Many other units in this enumeration refer to older definitions of measurement, and may be used by older coordinate systems and are included to allow older coordinate systems to be defined for the display and conversion of historical data. For example, both Sears and Clarke definitions of units are definitions of imperial units used in some older coordinate systems.
Each type of Unit is identified by a unique number which can be used to initialize and identify the unit in question - for each Unit property, this number is documented.
You may see this number referred to in some ArcGIS documentation as a factory code, projection engine code, or a Well Known Identifier (WKID). For example, ArcGIS Server web service APIs define WKID parameters which allow you to specify a particular unit; developing for ArcGIS using ArcObjects, these numbers are defined in enumeration sets that begin with 'esriSR', for example the enumerations esriSRUnitType and esriSRUnit2Type define identifiers for types of unit of measurement.
These identifier numbers are based on an industry standard defined by the European Petroleum Survey Group (EPSG), and very occasionally, the code value for which an enumeration stands may change; for this reason it is recommended that you use the enumeration member rather than the numeric value in code. Any changes will be noted in the change reports for this API. You can find out more information about the units and coordinate systems defined by the EPSG at their website, http://www.epsg.org.
Examples
// Get all the different types of Linear units. System.Reflection.PropertyInfo[] linearProps = typeof(Unit.Linear).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); // Report linear units. System.Diagnostics.Debug.WriteLine("Linear Units are:"); foreach (System.Reflection.PropertyInfo prop in linearProps) { Unit u = prop.GetValue(null, null) as Unit; System.Diagnostics.Debug.WriteLine(u.Name + "(" + u.Id.ToString() + ")"); } // Get all the different types of angular units. System.Reflection.PropertyInfo[] angularProps = typeof(Unit.Angular).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); // Report angular units. System.Diagnostics.Debug.WriteLine("Angular Units are:"); foreach (System.Reflection.PropertyInfo prop in angularProps) { Unit u = prop.GetValue(null, null) as Unit; System.Diagnostics.Debug.WriteLine(u.Name + "(" + u.Id.ToString() + ")"); } // Get all the different types of area units. System.Reflection.PropertyInfo[] areaProps = typeof(Unit.Area).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); // Report area units. System.Diagnostics.Debug.WriteLine("Area Units are:"); foreach (System.Reflection.PropertyInfo prop in areaProps) { Unit u = prop.GetValue(null, null) as Unit; System.Diagnostics.Debug.WriteLine(u.Name); // Area units do not have identifiers. }
' Get all the different types of Linear units. Dim linearProps As System.Reflection.PropertyInfo() = GetType(Unit.Linear).GetProperties(System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.Static) ' Report linear units. System.Diagnostics.Debug.WriteLine("Linear Units are:") Dim prop As System.Reflection.PropertyInfo For Each prop In linearProps Dim u As Unit = CType(prop.GetValue(Nothing, Nothing), Unit) System.Diagnostics.Debug.WriteLine(u.Name & "(" & u.Id.ToString() & ")") Next ' Get all the different types of angular units. Dim angularProps As System.Reflection.PropertyInfo() = GetType(Unit.Angular).GetProperties(System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.Static) ' Report angular units. System.Diagnostics.Debug.WriteLine("Angular Units are:") For Each prop In angularProps Dim u As Unit = CType(prop.GetValue(Nothing, Nothing), Unit) System.Diagnostics.Debug.WriteLine(u.Name & "(" & u.Id.ToString() & ")") Next ' Get all the different types of area units. Dim areaProps As System.Reflection.PropertyInfo() = GetType(Unit.Area).GetProperties(System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.Static) ' Report angular units. System.Diagnostics.Debug.WriteLine("Area Units are:") For Each prop In areaProps Dim u As Unit = CType(prop.GetValue(Nothing, Nothing), Unit) System.Diagnostics.Debug.WriteLine(u.Name) ' Area units do not have Identifiers Next