pe_vertcs_new |
Creates a new vertical coordinate system.
PE_VERTCS pe_vertcs_new(const char *name, PE_HVDATUM hvdatum,
PE_PARAMETER parameters[PE_PARM_MAX], PE_UNIT unit);
name | Name of the new vertical coordinate system |
hvdatum | A valid PE_HVDATUM (horizontal/vertical datum) object |
parameters | The array of vertical coordinate system parameters |
unit | Linear unit object |
Defines a new vertical coordinate system from the given specification. The
PE_HVDATUM is a supertype for either a horizontal or vertical datum. If the
vertical coordinate system is gravity-related, use a vertical datum. If the
vertical coordinate system is spheroid- or ellipsoid-based, use a horizontal
datum. A vertical coordinate system has two parameters
Vertical_Shift
Direction
The Direction can be either +1.0 or -1.0. The former value specifies that the z
values are positive 'up', or heights. The latter value (-1.0) specifies that the
z values are positive 'down', or depths, such as soundings on a nautical chart.
On success, the new vertical coordinate system with the given name. On failure, a null pointer.
int i;
PE_DATUM hdatum;
PE_PARAMETER par[PE_PARM_MAX]
PE_UNIT m;
PE_VERTCS vertcs;
for (i=0; i<PE_PARM_MAX; i++)
{
par[i] = 0;
}
par[PE_PARM_Z0] = pe_factory_parameter(PE_PAR_VERTICAL_SHIFT);
par[PE_PARM_DIR] = pe_factory_parameter(PE_PAR_DIRECTION);
/* Set the Z shift to zero and the direction to 'up'. */
pe_parameter_value_set(par[PE_PARM_Z0],0.0);
pe_parameter_value_set(par[PE_PARM_DIR],1.0);
hdatum = pe_factory_datum(6326); /* WGS84 datum - ellipsoid-based */
m = pe_factory_unit(9001);
/* Define an ellipsoid/spheroid-based vertical coordsys */
vertcs = pe_vertcs_new("MSL_LongBeach", hdatum, par, m);
pe_unit_del(m);
pe_datum_del(hdatum);
pe_vertcs_del(vertcs);