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


Creating a predefined projected coordinate system (ArcObjects .NET 10.4 SDK)

Creating a predefined projected coordinate system


About creating a predefined projected coordinate system

The ISpatialReferenceFactory interface provides access for creating a projected coordinate system (PCS) in ArcGIS. You can return a single PCS with ISpatialReferenceFactory.CreateProjectedCoordinateSystem. Lists of the supported PCS are available in the esriSRProjCSType, esriSRProjCS2Type, esriSRProj3Type, and esriSRGeoCS4Type enumerations.
See the following code example:
[C#]
private void CreateProjectedCoordinateSystem()
{
    // Set up the SpatialReferenceEnvironment.
    // SpatialReferenceEnvironment is a singleton object and needs to use the Activator class.

    Type t=Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
    System.Object obj=Activator.CreateInstance(t);
    ISpatialReferenceFactory srFact=obj as ISpatialReferenceFactory;

    // Use the enumeration to create an instance of the predefined object.

    IProjectedCoordinateSystem projectedCS=srFact.CreateProjectedCoordinateSystem(
        (int)esriSRProjCSType.esriSRProjCS_NAD1983UTM_11N);
}
[VB.NET]
Private Sub CreateProjectedReferenceSystem()
    ' Set up the SpatialReferenceEnvironment.
    ' SpatialReferenceEnvironment is a singleton object and needs to use the Activator class.
    
    Dim t As Type=Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment")
    Dim obj As System.Object=Activator.CreateInstance(t)
    Dim srFact As ESRI.ArcGIS.Geometry.ISpatialReferenceFactory=obj
    
    ' Use the enumeration to create an instance of the predefined object.
    
    Dim projectedCS As IProjectedCoordinateSystem=srFact.CreateProjectedCoordinateSystem(esriSRProjCSType.esriSRProjCS_NAD1983UTM_11N)
End Sub


See Also:

Creating a custom projected coordinate system




To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
Engine Developer Kit Engine