pe_vertcs_clone_alterunits

Updates the units and linear parameter values in a clone of a vertical coordinate system.

Usage syntax

PE_VERTCS pe_vertcs_clone_alterunits (PE_VERTCS vertcs, PE_UNIT linear_unit);
 

Parameters
vertcs A valid vertical coordinate system object
linear_unit A valid linear unit object
Description

Creates a clone of a vertical coordinate system object. The new vertical coordinate system has a new unit of measure. The Vertical_Shift parameter uses the same units as the coordinate system and the value is converted to the new unit.

Returns

On success, a new vertical coordinate system object. If the original vertcs is invalid, returns NULL. If the vertcs is valid, but the unit of measure parameter is NULL or invalid, a clone of the original vertcs is returned. If the unit object is valid, returns a clone of the vertcs with the appropriately updated unit and parameter.

Examples

PE_VERTCS newlyn;
PE_VERTCS newlyn_fathom;
PE_UNIT fathom;

/* The linear unit of Newlyn is meters. */
newlyn = pe_factory_vertcs(PE_VCS_NEWLYN);
fathom = pe_factory_unit(PE_U_FATHOM);
newlyn_fathom = pe_vertcs_clone_alterunits(newlyn,fathom);

pe_vertcs_del(newlyn);
pe_vertcs_del(newlyn_fathom);
pe_unit_del(fathom);