pe_projcs_clone_alterunits

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

Usage syntax

PE_PROJCS pe_projcs_clone_alterunits (PE_PROJCS projcs, (PE_UNIT linear_unit, PE_UNIT angular_unit);

Parameters
projcs The projected coordinate system object.
linear_unit The new linear unit object. Can be NULL.
angular_unit The new angular unit object. Can be NULL.
Description

Creates a clone of a projected coordinate system object. The new projected coordinate system has new units of measure. The projection parameters use the same units as the coordinate system and the values are converted to the new units. For example, if the original coordinate system uses US survey feet and you set the new linear unit of measure to meters, the false easting and false northing values are converted to meters. If the original geographic coordinate system uses decimal degrees and you set the new angular units to decimal minutes, the values of the angular parameters like central meridian, latitude of origin, and standard parallels are updated to decimal minutes.

Returns

On success, a new projected coordinate system object. If the original projcs is invalid, returns NULL. If the projcs is valid, but the two unit of measure parameters are NULL or invalid, a clone of the original projcs is returned. If either unit object is valid, returns a clone of the projcs with the appropriately update units.

Examples

PE_PROJCS ca5;
PE_UNIT meters;
PE_UNIT minutes;
/* The linear units of ca5 are US survey feet and the angular units are decimal degrees. */
ca5 = pe_factory_projcs(PE_PCS_NAD_1927_CA_V);
meters = pe_factory_unit(PE_U_METER);
minutes = pe_factory_unit(PE_U_MINUTE);
PE_PROJCS ca5_meters = pe_projcs_clone_alterunits(ca5,meters,minutes);