ArcObjects Library Reference (Geometry)  

ISpatialReferenceFactory.CreateSpheroid Method

Creates a predefined spheroid.

[Visual Basic .NET]
Public Function CreateSpheroid ( _
    ByVal spheroidType As Integer _
) As ISpheroid
[C#]
public ISpheroid CreateSpheroid (
    int spheroidType
);
[C++]
HRESULT CreateSpheroid(
  long spheroidType,
  ISpheroid** Spheroid
);
[C++]

Parameters

spheroidType   spheroidType is a parameter of type long Spheroid [out, retval]

  Spheroid is a parameter of type ISpheroid

Product Availability

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

Description

Use an element from the esriSRSpheroidType or esriSRSpheroid2Type enumerations as the spheroidType to create a particular predefined spheroid.

[C#]

            ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            //Create the spheroid using the available spheroids. These can be
            //found in the esriGeometry esriSRSpheroidType enumeration.
            ISpheroid spheroid = spatialReferenceFactory.CreateSpheroid((int)esriSRSpheroidType.esriSRSpheroid_Clarke1866);

[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 pSpher As ESRI.ArcGIS.Geometry.ISpheroid 'Create the spheroid using the available spheroids. These can be
        'found in the esriGeometry esriSRSpheroidType enumeration.
        pSpher = pSpatRefFact.CreateSpheroid(ESRI.ArcGIS.Geometry.esriSRSpheroidType.esriSRSpheroid_Clarke1866)

See Also

ISpatialReferenceFactory Interface | esriSRSpheroidType Constants | esriSRSpheroid2Type Constants

.NET Samples

Clonable object (Code Files: TestClass)