ArcObjects Library Reference (Geometry)  

IESRISpatialReferenceGEN Interface

Provides access to members that generate well known string (WKS) representations of spatial reference objects. IESRISpatialReference has been deprecated and IESRISpatialReferenceGEN should be used.

Product Availability

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

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]] 


 

Members

Description
Read-only property ESRISpatialReferenceSize The number of bytes required to hold the persistant representation of this spatial reference component.
Method ExportToESRISpatialReference Exports this spatial reference component to a buffer.
Method ImportFromESRISpatialReference Defines this spatial reference component from the specified ESRISpatialReference buffer.

CoClasses that implement IESRISpatialReferenceGEN

CoClasses and Classes Description
AngularUnit Creates a angular unit of measure.
Datum Creates a datum.
GeographicCoordinateSystem Creates a geographic coordinate system.
LinearUnit Creates a linear unit of measure.
Parameter Creates a parameter.
PrimeMeridian Creates a prime meridian.
ProjectedCoordinateSystem Creates a projected coordinate system.
Projection Creates a map projection.
Spheroid Creates a spheroid.
UnknownCoordinateSystem Creates an unknown coordinate system.
VerticalCoordinateSystem Creates a vertical coordinate system.
VerticalDatum Creates a vertical datum.

Remarks

If working with a .NET language or Java, use this interface rather than IESRISpatialReference.

[C#]
public void ExportToESRISpatialReference(ISpatialReference spatialReference)
{
long bytes = 0;
string buffer = null;
ISpatialReference projectedCoordinateSystem = spatialReference;
IESRISpatialReferenceGEN2 parameterExport = projectedCoordinateSystem;
parameterExport.ExportToESRISpatialReference2(buffer, bytes);
}
[Visual Basic .NET]
Public Sub ExportToESRISpatialReference(ByVal spatialReference As ISpatialReference)
      Dim bytes As Long = Nothing
      Dim buffer As String = Nothing
      Dim projectedCoordinateSystem As ISpatialReference = spatialReference
      Dim parameterExport As IESRISpatialReferenceGEN2 = projectedCoordinateSystem
      parameterExport.ExportToESRISpatialReference2(buffer, bytes)
End Sub