com.esri.arcgis.geometry
Interface IESRISpatialReference

All Superinterfaces:
Serializable
All Known Implementing Classes:
AngularUnit, Datum, GeographicCoordinateSystem, LinearUnit, Parameter, PrimeMeridian, ProjectedCoordinateSystem, Projection, Spheroid, UnknownCoordinateSystem, VerticalCoordinateSystem, VerticalDatum

public interface IESRISpatialReference
extends Serializable

Provides access to members that control the import/export operations components of a spatial reference system. This interface has been deprecated and IESRISpatialReferenceGEN should be used.

Description

This interface can be used by developers who are familiar with the Projection Engine format for persisting string representations of these components. The ESRISpatialReferenceSize property returns the number of bytes required to hold the projection engine string representation of object implementing this interface. This number is guaranteed to be large enough but may be larger than needed. The number returned from ExportToESRISpatialReference is the exact number of bytes used in the buffer to hold the string. The example code, which demonstrates how to use this method, expects that a valid SpatialReference object has already been created.

The ImportFromESRISpatialReference method defines a spatial reference from its Projection Engine string representation. If you open up a PRJ file in Notepad that contains the string description of a ProjectedCoordinateSystem, you will see something like (but as a single line):

PROJCS["Test",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984", 

SPHEROID["WGS_1984",6378137,298.257223]],PRIMEM["Greenwich",0], 

UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"], 

PARAMETER["false_easting",1000000],UNIT["Foot",0.3048]] 

Remarks

If working with a .NET language or Java, use the IESRISpatialReferenceGEN interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux


Method Summary
 void exportToESRISpatialReference(String[] str, int[] cBytesWrote)
          Exports this spatial reference component to a buffer.
 int getESRISpatialReferenceSize()
          The number of bytes required to hold the persistant representation of this spatial reference component.
 void importFromESRISpatialReference(String str, int[] cBytesRead)
          Defines this spatial reference component from the specified ESRISpatialReference buffer.
 

Method Detail

getESRISpatialReferenceSize

int getESRISpatialReferenceSize()
                                throws IOException,
                                       AutomationException
The number of bytes required to hold the persistant representation of this spatial reference component.

Description

Returns the size in bytes required to hold the persistent representation of a coordinate system. A sample string representation is below (reformatted for display).

PROJCS["Porto_Santo_1936_UTM_Zone_28N",
  GEOGCS["GCS_Porto_Santo_1936",
    DATUM["D_Porto_Santo_1936",
    SPHEROID["International_1924",6378388,297]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.0174532925199432955]],
  PROJECTION["Transverse_Mercator"],
  PARAMETER["False_Easting",500000],
  PARAMETER["False_Northing",0],
  PARAMETER["Central_Meridian",-15],
  PARAMETER["Scale_Factor",0.9996],
  PARAMETER["Latitude_Of_Origin",0],
  UNIT["Meter",1]]

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The cBytes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

importFromESRISpatialReference

void importFromESRISpatialReference(String str,
                                    int[] cBytesRead)
                                    throws IOException,
                                           AutomationException
Defines this spatial reference component from the specified ESRISpatialReference buffer.

Description

Converts a string representation of a coordinate system into a spatial reference object. A sample string representation is below (reformatted for display).

PROJCS["Porto_Santo_1936_UTM_Zone_28N",
  GEOGCS["GCS_Porto_Santo_1936",
    DATUM["D_Porto_Santo_1936",
    SPHEROID["International_1924",6378388,297]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.0174532925199432955]],
  PROJECTION["Transverse_Mercator"],
  PARAMETER["False_Easting",500000],
  PARAMETER["False_Northing",0],
  PARAMETER["Central_Meridian",-15],
  PARAMETER["Scale_Factor",0.9996],
  PARAMETER["Latitude_Of_Origin",0],
  UNIT["Meter",1]]

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
str - The str (in)
cBytesRead - The cBytesRead (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exportToESRISpatialReference

void exportToESRISpatialReference(String[] str,
                                  int[] cBytesWrote)
                                  throws IOException,
                                         AutomationException
Exports this spatial reference component to a buffer.

Description

Converts a spatial reference object into the string representation of a coordinate system. A sample string representation is below (reformatted for display).

PROJCS["Porto_Santo_1936_UTM_Zone_28N",
  GEOGCS["GCS_Porto_Santo_1936",
    DATUM["D_Porto_Santo_1936",
    SPHEROID["International_1924",6378388,297]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.0174532925199432955]],
  PROJECTION["Transverse_Mercator"],
  PARAMETER["False_Easting",500000],
  PARAMETER["False_Northing",0],
  PARAMETER["Central_Meridian",-15],
  PARAMETER["Scale_Factor",0.9996],
  PARAMETER["Latitude_Of_Origin",0],
  UNIT["Meter",1]]

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
str - The str (in/out: use single element array)
cBytesWrote - The cBytesWrote (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.