pe_coordsys_vertcs_to_prjstring

Converts horizontal and vertical coordinate system objects to an old-style PRJ file in string format

Usage syntax

void pe_coordsys_vertcs_to_prjstring (PE_COORDSYS coordsys, PE_VERTCS vertcs, const char *string, int *ierror);

Parameters
coordsys A horizontal coordinate system object
vertcs A vertical coordinate system object
string A pointer to a string that will contain an old-style PRJ file in string format
ierror A pointer to an error code
Description

This function converts horizontal and vertical coordinate system objects to an old-style PRJ file in string format. An old-style PRJ file is used by the coverage, grid, and TIN data formats. The files, named prj.adf, are located in the dataset directory.

Here is a sample PRJ file.

Projection  UTM 
Units       METERS 
Zunits      METERS
Datum       WGS84 
Spheroid    WGS84 
Zone        11 
Parameters 

Here is the equivalent PE string representation (reformatted for display) of PE projected and vertical coordinate system objects.

PROJCS["WGS_1984_UTM_Zone_11N",
   GEOGCS["GCS_WGS_1984", 
      DATUM["D_WGS_1984",
         SPHEROID["WGS_1984",6378137,298.257223563]],
      PRIMEM["Greenwich",0],
      UNIT["Degree",0.0174532925199433]],
   PROJECTION["Transverse_Mercator"],
   PARAMETER["False_Easting",500000.0],
   PARAMETER["False_Northing",0.0], 
   PARAMETER["Central_Meridian",-117.0],
   PARAMETER["Scale_Factor",0.9996],
   PARAMETER["Latitude_Of_Origin",0.0],
   UNIT["Meter",1]],
   VERTCS["Unknown VCS", 
      VDATUM["Unknown",
      PARAMETER["Vertical_Shift",0.0],
      PARAMETER["Direction",1.0],
      UNIT["Meter",1]]

Note: You need to include the pe_coordsys_from_prj.h header file to use this function. This file is included with the ArcSDE SDK.

Returns

On success, an old-style PRJ file; otherwise, one of the following is returned:

   PE_PRJ_CANNOT_OPEN_FILE      The path or file name is incorrect or does not exist.

   PE_PRJ_ILLEGAL_ARGUMENT      The pointer to the path or file name is null or blank.

   PE_TOPRJ_ILLEGAL_PARAMETER   One of the parameters is incorrect or cannot be converted. The equivalent map projection in ArcInfo Workstation may not support the parameter.

   PE_TOPRJ_ILLEGAL_PRIMEM      The prime meridian is not Greenwich and cannot be converted.

   PE_TOPRJ_ILLEGAL_PROJECTION  The map projection cannot be converted. ArcInfo Workstation may not support it.

   PE_PRJ_ILLEGAL_SCALE_FACTOR  The scale factor parameter is not supported by the equivalent map projection in ArcInfo Workstation.

   PE_TOPRJ_ILLEGAL_SPHEROID    The spheroid is incorrect or cannot be converted. The map projection in ArcInfo Workstation may not support a spheroid.

   PE_TOPRJ_ILLEGAL_UNIT        The unit is incorrect or cannot be converted. ArcInfo Workstation may not support it. Usually will occur when the units of the geographic coordinate system are grads.

   PE_PRJ_OUT_OF_MEMORY         The string is not long enough or the system has run out of memory.

Examples
PE_COORDSYS coordsys;
PE_VERTCS vcs;
char *prjstring;
int err = 0;
/* Define the coordsys and vertcs */
pe_coordsys_vertcs_to_prjstring(coordsys,vertcs,prjstring,&err);
if (err != 0)
{
   printf("Error code = %d\n",err);
}