|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISpatialReferenceFactory
Provides access to members that create different kinds of spatial reference components.
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.
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 |
---|
void createESRISpatialReference(String spatRefInfo, ISpatialReference[] spatialReference, int[] cBytesRead) throws IOException, AutomationException
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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISpatialReference createESRISpatialReferenceFromPRJ(String prj) throws IOException, AutomationException
Not implemented for GeographicCoordinateSystem and ProjectedCoordinateSystem. Use the CreateESRISpatialReference or CreateESRISpatialReferenceFromPRJFile methods instead.
prj
- The prj (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISpatialReference createESRISpatialReferenceFromPRJFile(String prjFile) throws IOException, AutomationException
Both old style (workstation) and new style (arcview) prj files can be used with this method to create spatial reference system objects.
prjFile
- The prjFile (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void exportESRISpatialReferenceToPRJFile(String prjFile, ISpatialReference spatialReference) throws IOException, AutomationException
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]]
To convert a spatialreference into an ArcInfo workstation format (for TINs, GRIDs, or coverages), use IPRJSpatialReferenceGEN_ExportSpatialReferenceToPRJ.
prjFile
- The prjFile (in)spatialReference
- A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IUnit createUnit(int unitType) throws IOException, AutomationException
Use an element from the esriSRUnitType or esriSRUnit2Type enumerations as the unitType to create a particular predefined unit of measure.
unitType
- The unitType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRUnit2Type
,
esriSRUnitType
ISpheroid createSpheroid(int spheroidType) throws IOException, AutomationException
Use an element from the esriSRSpheroidType or esriSRSpheroid2Type enumerations as the spheroidType to create a particular predefined spheroid.
spheroidType
- The spheroidType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRSpheroid2Type
,
esriSRSpheroidType
IDatum createDatum(int datumType) throws IOException, AutomationException
Use an element from the esriSRDatumType, esriSRDatum2Type, or esriSRDatum3Type enumerations as the datumType to create a particular predefined horizontal datum.
datumType
- The datumType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRDatumType
,
esriSRDatum2Type
,
esriSRDatum3Type
IPrimeMeridian createPrimeMeridian(int primeMeridianType) throws IOException, AutomationException
Use an element from the esriSRPrimeMType or esriSRPrimeM2Type enumerations as the primeMeridianType to create a particular predefined prime meridian.
primeMeridianType
- The primeMeridianType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IProjection createProjection(int projectionType) throws IOException, AutomationException
Use an element from the esriSRProjectionType, esriSRProjection2Type, esriSRProjection3Type, or esriSRProjection4Type enumerations as the projectionType to create a particular predefined map projection.
projectionType
- The projectionType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRProjection2Type
,
esriSRProjection3Type
,
esriSRProjection4Type
,
esriSRProjectionType
IParameter createParameter(int parameterType) throws IOException, AutomationException
Use an element from the esriSRParameterType, esriSRParameter2Type, esriSRParameter3Type, or esriSRParameter4Type enumerations as the ParameterType to create a particular predefined parameter.
parameterType
- The parameterType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRParameter2Type
,
esriSRParameter3Type
,
esriSRParameter4Type
,
esriSRParameterType
IProjectedCoordinateSystem createProjectedCoordinateSystem(int pcsType) throws IOException, AutomationException
Use an element from the esriSRProjCSType, esriSRProjCS2Type, esriSRProjCS3Type, or esriSRProjCS4Type enumerations as the pcsType to create a particular predefined projected coordinate system.
pcsType
- The pcsType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRProjCSType
,
esriSRProjCS2Type
,
esriSRProjCS3Type
,
esriSRProjCS4Type
IGeographicCoordinateSystem createGeographicCoordinateSystem(int gcsType) throws IOException, AutomationException
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.
gcsType
- The gcsType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRGeoCSType
,
esriSRGeoCS2Type
,
esriSRGeoCS3Type
ITransformation createGeoTransformation(int gTransformationType) throws IOException, AutomationException
Use an element from the esriSRGeoTransformationType, esriSRGeoTransformation2Type, or esriSRGeoTransformation3Type enumerations as the gTransformationType to create a particular predefined geographic (datum) transformation.
gTransformationType
- The gTransformationType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.esriSRGeoTransformationType
,
esriSRGeoTransformation2Type
,
esriSRGeoTransformation3Type
ISet createPredefinedProjections() throws IOException, AutomationException
Create a set of all predefined map projection objects.
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISet createPredefinedLinearUnits() throws IOException, AutomationException
Returns a list of all predefined linear units. The list has two columns: the factory code and the name.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISet createPredefinedDatums() throws IOException, AutomationException
Returns a list of all predefined horizontal datums. The list has two columns: the factory code and the name.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISet createPredefinedAngularUnits() throws IOException, AutomationException
Returns a list of all predefined angular units. The list has two columns: the factory code and the name.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISet createPredefinedPrimeMeridians() throws IOException, AutomationException
Returns a list of all predefined prime meridians. The list has two columns: the factory code and the name.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ISet createPredefinedSpheroids() throws IOException, AutomationException
Returns a list of all predefined spheroids. The list has two columns: the factory code and the name.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |