com.esri.arcgis.geometry
Interface ISpatialReferenceFactory

All Superinterfaces:
Serializable
All Known Subinterfaces:
ISpatialReferenceFactory2, ISpatialReferenceFactory3
All Known Implementing Classes:
SpatialReferenceEnvironment

public interface ISpatialReferenceFactory
extends Serializable

Provides access to members that create different kinds of spatial reference components.

Superseded By

ISpatialReferenceFactory3

Remarks

The ISpatialReferenceFactory interface provides methods that use the FactoryCode to generate predefined factory spatial reference objects. There are three types of functions on this interface: those that return single objects, those that return a set of objects of the same type, and those that are used to import and export SpatialReference objects to and from a PRJ file or a PRJ string representation. For example, the CreateGeographicCoordinateSystem function takes as its only parameter an integer that represents the FactoryCode of a predefined geographic coordinate system. The function returns a GCS whose coordinate system has been defined. Its coordinate grids and tolerance, though, have not yet been defined.

Thousands of coordinate system related objects are available through the esriSR... enumerations. To maintain compatibility between versions, each object, such as a geographic coordinate system, will have more than one enumeration. Use the enumeration elements (for example, esriSRGeoCS_WGS1984) rather than the integer value it represents. Many of the FactoryCode values are based on an external standard and the values may change.

The next type of function on the ISpatialReferenceFactory interface returns a complete Set of objects. These type of functions are useful for developers who may wish to populate a pulldown selection list of available SpatialReference objects.

The third type of function supported by ISpatialReferenceFactory deals with PRJ files and strings. CreateESRISpatialReferenceFromPRJFile takes an old or new style PRJ file and creates either a geographic or projected coordinate system from it, depending on the file contents. The old style PRJ is used with coverages, TINs, and GRIDs. CreateESRISpatialReferenceFromPRJ is used to create a SpatialReference based on the string buffer of an old style PRJ file. While CreateESRISpatialReference is similar, the string buffer must be in the format of a new PRJ file. Conversely, the ExportESRISpatialReferenceToPRJFile function provides a mechanism to take a SpatialReference object and create a new style PRJ file from it. These four functions provide you with a way to take advantage of existing routines that involve the use of PRJ files. They also provide an easy and effective way to exchange spatial reference information through the use of text files. If you plan to work with vertical coordinate systems, use the ISpatialReferenceFactory3 versions of these methods.

Product Availability

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


Method Summary
 IDatum createDatum(int datumType)
          Creates a predefined datum.
 void createESRISpatialReference(String spatRefInfo, ISpatialReference[] spatialReference, int[] cBytesRead)
          Creates a spatial reference system and defines it from the specified ESRISpatialReference buffer.
 ISpatialReference createESRISpatialReferenceFromPRJ(String prj)
          Creates a spatial reference from a PRJ string.
 ISpatialReference createESRISpatialReferenceFromPRJFile(String prjFile)
          Creates a spatial reference from a PRJ file.
 IGeographicCoordinateSystem createGeographicCoordinateSystem(int gcsType)
          Creates a predefined geographic coordinate system.
 ITransformation createGeoTransformation(int gTransformationType)
          Creates a predefined transformation between geographic coordinate systems.
 IParameter createParameter(int parameterType)
          Creates a predefined parameter.
 ISet createPredefinedAngularUnits()
          Creates a list of predefined angular units.
 ISet createPredefinedDatums()
          Creates a list of a list of predefined datums.
 ISet createPredefinedLinearUnits()
          Creates a list of predefined linear units.
 ISet createPredefinedPrimeMeridians()
          Creates a list of predefined prime meridians.
 ISet createPredefinedProjections()
          Creates a list of predefined projections.
 ISet createPredefinedSpheroids()
          Creates a list of predefined spheroids.
 IPrimeMeridian createPrimeMeridian(int primeMeridianType)
          Creates a predefined prime meridian.
 IProjectedCoordinateSystem createProjectedCoordinateSystem(int pcsType)
          Creates a predefined projected coordinate system.
 IProjection createProjection(int projectionType)
          Creates a predefined projection.
 ISpheroid createSpheroid(int spheroidType)
          Creates a predefined spheroid.
 IUnit createUnit(int unitType)
          Creates a predefined unit of measure.
 void exportESRISpatialReferenceToPRJFile(String prjFile, ISpatialReference spatialReference)
          Exports a spatial reference to a PRJ file.
 

Method Detail

createESRISpatialReference

void createESRISpatialReference(String spatRefInfo,
                                ISpatialReference[] spatialReference,
                                int[] cBytesRead)
                                throws IOException,
                                       AutomationException
Creates a spatial reference system and defines it from the specified ESRISpatialReference buffer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
spatRefInfo - The spatRefInfo (in)
spatialReference - A reference to a com.esri.arcgis.geometry.ISpatialReference (out: use single element array)
cBytesRead - The cBytesRead (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createESRISpatialReferenceFromPRJ

ISpatialReference createESRISpatialReferenceFromPRJ(String prj)
                                                    throws IOException,
                                                           AutomationException
Creates a spatial reference from a PRJ string.

Description

Not implemented for GeographicCoordinateSystem and ProjectedCoordinateSystem. Use the CreateESRISpatialReference or CreateESRISpatialReferenceFromPRJFile methods instead.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
prj - The prj (in)
Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createESRISpatialReferenceFromPRJFile

ISpatialReference createESRISpatialReferenceFromPRJFile(String prjFile)
                                                        throws IOException,
                                                               AutomationException
Creates a spatial reference from a PRJ file.

Remarks

Both old style (workstation) and new style (arcview) prj files can be used with this method to create spatial reference system objects.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
prjFile - The prjFile (in)
Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportESRISpatialReferenceToPRJFile

void exportESRISpatialReferenceToPRJFile(String prjFile,
                                         ISpatialReference spatialReference)
                                         throws IOException,
                                                AutomationException
Exports a spatial reference to a PRJ file.

Description

ExportESRISpatialReferenceToPRJFile converts an ArcGIS style spatial reference into the well-known text string. Here is an example (reformatted):

GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.0174532925199433]]

Remarks

To convert a spatialreference into an ArcInfo workstation format (for TINs, GRIDs, or coverages), use IPRJSpatialReferenceGEN_ExportSpatialReferenceToPRJ.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
prjFile - The prjFile (in)
spatialReference - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createUnit

IUnit createUnit(int unitType)
                 throws IOException,
                        AutomationException
Creates a predefined unit of measure.

Description

Use an element from the esriSRUnitType or esriSRUnit2Type enumerations as the unitType to create a particular predefined unit of measure.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
unitType - The unitType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IUnit
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRUnit2Type, esriSRUnitType

createSpheroid

ISpheroid createSpheroid(int spheroidType)
                         throws IOException,
                                AutomationException
Creates a predefined spheroid.

Description

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
spheroidType - The spheroidType (in)
Returns:
A reference to a com.esri.arcgis.geometry.ISpheroid
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRSpheroid2Type, esriSRSpheroidType

createDatum

IDatum createDatum(int datumType)
                   throws IOException,
                          AutomationException
Creates a predefined datum.

Description

Use an element from the esriSRDatumType, esriSRDatum2Type, or esriSRDatum3Type enumerations as the datumType to create a particular predefined horizontal datum.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
datumType - The datumType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IDatum
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRDatumType, esriSRDatum2Type, esriSRDatum3Type

createPrimeMeridian

IPrimeMeridian createPrimeMeridian(int primeMeridianType)
                                   throws IOException,
                                          AutomationException
Creates a predefined prime meridian.

Description

Use an element from the esriSRPrimeMType or esriSRPrimeM2Type enumerations as the primeMeridianType to create a particular predefined prime meridian.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
primeMeridianType - The primeMeridianType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IPrimeMeridian
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createProjection

IProjection createProjection(int projectionType)
                             throws IOException,
                                    AutomationException
Creates a predefined projection.

Description

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
projectionType - The projectionType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IProjection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRProjection2Type, esriSRProjection3Type, esriSRProjection4Type, esriSRProjectionType

createParameter

IParameter createParameter(int parameterType)
                           throws IOException,
                                  AutomationException
Creates a predefined parameter.

Description

Use an element from the esriSRParameterType, esriSRParameter2Type, esriSRParameter3Type, or esriSRParameter4Type enumerations as the ParameterType to create a particular predefined parameter.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
parameterType - The parameterType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IParameter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRParameter2Type, esriSRParameter3Type, esriSRParameter4Type, esriSRParameterType

createProjectedCoordinateSystem

IProjectedCoordinateSystem createProjectedCoordinateSystem(int pcsType)
                                                           throws IOException,
                                                                  AutomationException
Creates a predefined projected coordinate system.

Description

Use an element from the esriSRProjCSType, esriSRProjCS2Type, esriSRProjCS3Type, or esriSRProjCS4Type enumerations as the pcsType to create a particular predefined projected coordinate system.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
pcsType - The pcsType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IProjectedCoordinateSystem
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRProjCSType, esriSRProjCS2Type, esriSRProjCS3Type, esriSRProjCS4Type

createGeographicCoordinateSystem

IGeographicCoordinateSystem createGeographicCoordinateSystem(int gcsType)
                                                             throws IOException,
                                                                    AutomationException
Creates a predefined geographic coordinate system.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
gcsType - The gcsType (in)
Returns:
A reference to a com.esri.arcgis.geometry.IGeographicCoordinateSystem
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRGeoCSType, esriSRGeoCS2Type, esriSRGeoCS3Type

createGeoTransformation

ITransformation createGeoTransformation(int gTransformationType)
                                        throws IOException,
                                               AutomationException
Creates a predefined transformation between geographic coordinate systems.

Description

Use an element from the esriSRGeoTransformationType, esriSRGeoTransformation2Type, or esriSRGeoTransformation3Type enumerations as the gTransformationType to create a particular predefined geographic (datum) transformation.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
gTransformationType - The gTransformationType (in)
Returns:
A reference to a com.esri.arcgis.geometry.ITransformation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriSRGeoTransformationType, esriSRGeoTransformation2Type, esriSRGeoTransformation3Type

createPredefinedProjections

ISet createPredefinedProjections()
                                 throws IOException,
                                        AutomationException
Creates a list of predefined projections.

Description

Create a set of all predefined map projection objects.

Remarks

A Projection object encapsulates the mathematics needed to convert geographic coordinates between two different coordinate systems. A projection is a component of a projected coordinate system and is not usually used directly. Rather, a projected cooordinate system is defined and used to project cooordinates.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.ISet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createPredefinedLinearUnits

ISet createPredefinedLinearUnits()
                                 throws IOException,
                                        AutomationException
Creates a list of predefined linear units.

Description

Returns a list of all predefined linear units. The list has two columns: the factory code and the name.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.ISet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createPredefinedDatums

ISet createPredefinedDatums()
                            throws IOException,
                                   AutomationException
Creates a list of a list of predefined datums.

Description

Returns a list of all predefined horizontal datums. The list has two columns: the factory code and the name.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.ISet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createPredefinedAngularUnits

ISet createPredefinedAngularUnits()
                                  throws IOException,
                                         AutomationException
Creates a list of predefined angular units.

Description

Returns a list of all predefined angular units. The list has two columns: the factory code and the name.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.ISet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createPredefinedPrimeMeridians

ISet createPredefinedPrimeMeridians()
                                    throws IOException,
                                           AutomationException
Creates a list of predefined prime meridians.

Description

Returns a list of all predefined prime meridians. The list has two columns: the factory code and the name.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.ISet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createPredefinedSpheroids

ISet createPredefinedSpheroids()
                               throws IOException,
                                      AutomationException
Creates a list of predefined spheroids.

Description

Returns a list of all predefined spheroids. The list has two columns: the factory code and the name.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.ISet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.