This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IS > ISpatialReferenceFactory Interface > ISpatialReferenceFactory.CreateGeographicCoordinateSystem Method (ArcObjects .NET 10.4 SDK) |
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
Use an element from the esriSRGeoCSType, esriSRGeoCS2Type, or esriSRGeoCS3Type enumerations as the gcsType to create a particular predefined geographic coordinate system.
The example code shows how to create an object that represents the WGS 1984 geographic coordinate system.
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);
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)
ISpatialReferenceFactory Interface | esriSRGeoCSType Constants | esriSRGeoCS2Type Constants | esriSRGeoCS3Type Constants