c_trans - Converts coordinates from one datum, map projection and/or unit to another.

SYNTAX

#include "worgen.h"

FUNCTION c_trans (inproj, inunit, outproj, outunit, inx, iny, outx, outy)

     long                *inproj;
     long                *inunit;
     long                *outproj;
     long                *outunit;
     double              *inx;
     double              *iny;
     double              *outx;
     double              *outy;

PARAMETERS

inproj (input, long)

Defines the input projection system. Refer to c_transinit() for a list of valid projection system codes.

inunit (input, long)

Unit code for value in inx and iny. Refer to c_transinit() for a list of valid unit codes.

outproj (output, long)

Defines the output projection system. Refer to c_transinit() for a list of valid projection system codes.

outunit (output, long)

Unit code for value in outx and outy. Refer to c_transinit() for a list of valid unit codes.

inx (input, double)

Input X coordinate (X, Longitude, Easting, etc). East is taken as positive, west as negative.

iny (input, double)

Input Y coordinate (Y, Latitude, Northing, etc). North is taken as positive, south as negative.

outx (output, double)

Output X coordinate (X, Longitude, Easting, etc). East is taken as positive, west as negative.

outy (output, double)

Output Y coordinate (Y, Latitude, Northing, etc). North is taken as positive, south as negative.

DESCRIPTION

This function transforms coordinate pairs from one map projection, unit, and/or datum to another. The primary workhorse for the projection conversion routines of this package is the U.S. Geological Survey's General Cartographic Transformation Package (GCTP), although it has been buffered from the application routines to minimize changes to calling programs when the GCTP is changed or added to. The datum conversion routines were implemented based on DATUMCHG, which utilizes the Bursa-Wolf 7 parameter transformation.

Before using c_trans(), the transformation package must be initialized by calling c_transinit(). Additional information and references may be found in c_transinit().

RETURN VALUE

c_trans() returns

     E_SUCC (0)  --> successful completion
     E_FAIL (-1) --> coordinate transformation failed
     IN_BREAK (-2) --> coordinate is undefined 
Table A: UTM Zone Codes, Locations and Central Meridians

Table B: Jurisdictions, State Plane Coordinate Systems, and Zone Representations

Table C: Parameters Required for Definition of Map Projections