Gets the unique internal identifier of this CoordinateSystem, sometimes referred to as the factory code or Well Known ID (WKID).

Namespace:  ESRI.ArcGISExplorer.Geometry

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public int Id { get; }
Visual Basic (Declaration)
Public ReadOnly Property Id As Integer

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

The code below shows how you can identify any layers in the current MapDisplay with a CoordinateSystem that is different to that of the MapDisplay. A list of all Layers is created, showing which use the same CoordinateSystem as the MapDisplay, and which use a different CoordinateSystem (and are therefore reprojected automatically when drawn), and creates a list of these layers. The code assumes you have imported the Geometry and Mapping namespaces.
CopyC#
// 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");
CopyVB.NET
' 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")

See Also