ArcObjects Library Reference (Geometry)  

ISpatialReferenceFactory.CreateGeographicCoordinateSystem Method

Creates a predefined geographic coordinate system.

[Visual Basic .NET]
Public Function CreateGeographicCoordinateSystem ( _
    ByVal gcsType As Integer _
) As IGeographicCoordinateSystem
[C#]
public IGeographicCoordinateSystem CreateGeographicCoordinateSystem (
    int gcsType
);
[C++]
HRESULT CreateGeographicCoordinateSystem(
  long gcsType,
  IGeographicCoordinateSystem** gcs
);
[C++]

Parameters

gcsType   gcsType is a parameter of type long gcs [out, retval]

  gcs is a parameter of type IGeographicCoordinateSystem

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Use an element from the esriSRGeoCSType, esriSRGeoCS2Type, or esriSRGeoCS3Type enumerations as the gcsType to create a particular predefined geographic coordinate system.

Remarks

The example code shows how to create an object that represents the WGS 1984 geographic coordinate system.

[C#]

            ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            //Create a geographic coordinate system using the available geographic
            //coordinate systems. These can be found in the esriGeometry esriSRGeoCSType
            //enumeration.
            IGeographicCoordinateSystem geographicCoordinateSystem = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);

[Visual Basic .NET]

        Dim pSpatRefFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory
        'Set the spatial reference factory to a new spatial reference environment
        pSpatRefFact = New ESRI.ArcGIS.Geometry.SpatialReferenceEnvironment

        Dim pGCS As ESRI.ArcGIS.Geometry.IGeographicCoordinateSystem

        'Create a geographic coordinate system using the available geographic
        'coordinate systems. These can be found in the esriGeometry esriSRGeoCSType
        'enumeration.

        pGCS = pSpatRefFact.CreateGeographicCoordinateSystem(ESRI.ArcGIS.Geometry.esriSRGeoCSType.esriSRGeoCS_WGS1984)

See Also

ISpatialReferenceFactory Interface | esriSRGeoCSType Constants | esriSRGeoCS2Type Constants | esriSRGeoCS3Type Constants

.NET Samples

RSS weather GraphicTracker (Code Files: RSSWeather) | Geoevents in a MapControl (Code Files: GeoEvents) | RSS weather layer (Code Files: AddWeatherItemTool RSSWeatherLayerClass) | Clonable object (Code Files: TestClass)

.NET Related Topics

Creating a custom projected coordinate system | Creating a predefined geographic coordinate system | How to use the IGeoTransformationOperationSet methods