This document is archived and information here might be outdated.  Recommended version.


ISpatialReferenceFactory.CreateGeographicCoordinateSystem Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IS > ISpatialReferenceFactory Interface > ISpatialReferenceFactory.CreateGeographicCoordinateSystem Method
ArcGIS Developer Help

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
);
[C++]
Parameters
gcsType 

gcsType is a parameter of type long

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

Clonable object Geoevents in a MapControl RSS weather GraphicTracker RSS weather layer RSS weather layer