ArcGIS Explorer Component Help |
CoordinateSystem..::.Id Property |
CoordinateSystem Class Example See Also |
Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
Field Value
An integer indicating the unique identifier of this CoordinateSystem.Remarks
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.
If this value is -1, this indicates that this CoordinateSystem is not one of the predefined standard systems but is a customized system; coordinate systems may be customized by other ArcGIS software, and may for example have been saved as the coordinate system of a data set which is then accessed via this API.
Examples
// Identify the CoordinateSystem of the current DisplayMode using the shortcut property. ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; CoordinateSystem dispCS = disp.CurrentCoordinateSystem; // Iterate all Layers in the Map. StringBuilder sameCs = new StringBuilder(Environment.NewLine); StringBuilder diffCs = new StringBuilder(Environment.NewLine); System.Collections.ObjectModel.ReadOnlyCollection<Layer> layers = disp.Map.GetMapItems<Layer>(); foreach (Layer lyr in layers) { // Show information about the CoordinateSystem using the overloaded ToString method. string info = lyr.Name + ": " + lyr.CoordinateSystem.ToString(); // Compare the systems using the Id property. if (lyr.CoordinateSystem.Id == dispCS.Id) sameCs.AppendLine(info); else diffCs.AppendLine(info); } // Show the results. MessageBox.Show("Layers which are automatically reprojected: " + diffCs.ToString() + Environment.NewLine + "Layers which do not require reprojecting: " + sameCs.ToString(), "Layer Coordinate Systems");
' Identify the CoordinateSystem of the current DisplayMode using the shortcut property. Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay Dim dispCS As CoordinateSystem = disp.CurrentCoordinateSystem ' Iterate all Layers in the Map. Dim sameCs As New StringBuilder(Environment.NewLine) Dim diffCs As New StringBuilder(Environment.NewLine) Dim layers As System.Collections.ObjectModel.ReadOnlyCollection(Of Layer) = disp.Map.GetMapItems(Of Layer)() Dim lyr As Layer For Each lyr In layers ' Show information about the CoordinateSystem using the overloaded ToString method. Dim info As String = lyr.Name & ": " & lyr.CoordinateSystem.ToString() ' Compare the systems using the Id property. If lyr.CoordinateSystem.Id = dispCS.Id Then sameCs.AppendLine(info) Else diffCs.AppendLine(info) End If Next lyr ' Show the results. MessageBox.Show("Layers which are automatically reprojected: " + diffCs.ToString() + Environment.NewLine + _ "Layers which do not require reprojecting: " + sameCs.ToString(), _ "Layer Coordinate Systems")