ArcObjects Library Reference (Geometry)  

ISpatialReferenceFactory.CreateProjection Method

Creates a predefined projection.

[Visual Basic .NET]
Public Function CreateProjection ( _
    ByVal projectionType As Integer _
) As IProjection
[C#]
public IProjection CreateProjection (
    int projectionType
);
[C++]
HRESULT CreateProjection(
  long projectionType,
  IProjection** Projection
);
[C++]

Parameters

projectionType   projectionType is a parameter of type long Projection [out, retval]

  Projection is a parameter of type IProjection

Product Availability

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

Description

Use an element from the esriSRProjectionType, esriSRProjection2Type, esriSRProjection3Type, or esriSRProjection4Type enumerations as the projectionType to create a particular predefined map projection.

[C#]

            ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
            //Create a projections using the available projections. These can be
            //found in the esriGeometry esriSRProjectionType, esriSRProjection2Type,
            //esriSRProjection3Type, and esriSRProjection4Type enumerations.
            IProjection projection = spatialReferenceFactory.CreateProjection((int)esriSRProjectionType.esriSRProjection_LambertConformalConic);

[Visual Basic .NET]

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

        'Create a projections using the available projections. These can be
        'found in the esriGeometry esriSRProjectionType, esriSRProjection2Type,
        'esriSRProjection3Type, and esriSRProjection4Type enumerations.
        Dim pProj As ESRI.ArcGIS.Geometry.IProjection
        pProj = pSpatRefFact.CreateProjection(ESRI.ArcGIS.Geometry.esriSRProjectionType.esriSRProjection_LambertConformalConic)

See Also

ISpatialReferenceFactory Interface | esriSRProjectionType Constants | esriSRProjection2Type Constants | esriSRProjection3Type Constants | esriSRProjection4Type Constants

.NET Related Topics

Creating a custom projected coordinate system |