pe_vertcs_from_prjstring

Creates a vertical coordinate system object from an old-style PRJ file formatted as a string

Usage syntax

PE_VERTCS pe_vertcs_from_prjstring (const char *string, int *ierror);

Parameters
string The pointer to a string created from an old-style PRJ file
ierror The pointer to an error code
Description

This function creates a PE vertical coordinate system object from an old-style PRJ file. An old-style PRJ file is used by the coverage, grid, and TIN data formats. You can find the file, named prj.adf, in the dataset directory. Here is a sample PRJ file.

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

Below is the string representation (reformatted for display) of the PE vertical coordinate system object.

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, a vertical coordinate system object; otherwise, one of the following is returned:

   PE_PRJ_ILLEGAL_ARGUMENT     The pointer to the path or file name is null or blank.
PE_PRJ_CANNOT_OPEN_FILE     The path or file name is incorrect or does not exist.
PE_PRJ_ILLEGAL_KEYWORD      A keyword is incorrect or cannot be converted.
PE_PRJ_TOO_MANY_PARAMS      There are too many parameters in the PRJ string. The PRJ file is incorrect.
PE_PRJ_ILLEGAL_DATUM        The datum is incorrect or cannot be converted.
PE_PRJ_ILLEGAL_PARAMETER    One of the parameters is incorrect or cannot be converted.
PE_PRJ_ILLEGAL_PROJECTION   The map projection cannot be converted. PE may not support it.
PE_PRJ_ILLEGAL_SPHEROID     The spheroid is incorrect or cannot be converted.
PE_PRJ_ILLEGAL_UNIT         The unit is incorrect or cannot be converted.
PE_PRJ_ILLEGAL_ZONE         The zone is incorrect or cannot be converted.
PE_PRJ_NO_ZUNIT             The zunit is missing from the old-style PRJ file.
PE_PRJ_OUT_OF_MEMORY        The string is not long enough or the system has run out of memory.

Examples
PE_VERTCS vertcs;
/* Note: The prjstring cannot be modified because it is hardcoded. */
char *prjstring = "Projection UTM\nUnits METERS\nZUnits METERS\nDatum WGS84\nZone  11\nParameters\n";
int err = 0;
char newstring[2048];

coordsys = pe_vertcs_from_prjstring(prjstring,&err);
if (err != 0)
{
   printf("Error code = %d\n",err);
}
else
{
   pe_vertcs_to_string(vertcs,newstring);
   printf("%s\n",newstring);
}