c_transinit - Initializes the parameters needed for projection and datum transformations.

SYNTAX

#include "worgen.h"
#include "proj.h"
FUNCTION c_transinit (inproj, inunit, inzone, indatum, inparm, outproj, outunit, outzone, outdatum, outparm, prtprm, fname)

     long               *inproj;
     long               *inunit;
     long               *inzone;
     long               *indatum;
     double              inparm[15];
     long               *outproj;
     long               *outunit;
     long               *outzone;
     long               *outdatum;
     double              outparm[15];
     long                prtprm[2];
     char               *fname;

PARAMETERS

inproj (input, long)

Defines input projection system. Valid codes are:

     GEO          0     Geographic 
     UTM          1     Universal Transverse Mercator
     SPCS         2     State Plane Coordinates    
     ALBERS       3     Albers Conical Equal Area
     LAMCC        4     Lambert Conformal Conic
     MERCAT       5     Mercator
     PS           6     Polar Stereographic  
     POLYC        7     Polyconic
     EQUIDC       8     Equidistant Conic 
     TM           9     Transverse Mercator
     STEREO      10     Stereographic 
     LAMAZ       11     Lambert Azimuthal Equal Area
     AZMEQD      12     Azimuthal Equidistant
     GNOMON      13     Gnomonic
     ORTHO       14     Orthographic 
     GVNSP       15     General Vertical Near-Side Perspective
     SNSOID      16     Sinusoidal 
     EQRECT      17     Equirectangular
     MILLER      18     Miller Cylindrical
     VGRINT      19     Van der Grinten
     HOM         20     Oblique Mercator (Hotine)
     ROBINSON    21     Robinson 
     SOM         22     Space Oblique Mercator (SOM)
     ALASKA      23     Alaska Conformal
     GOODE       24     Interrupted Goode
     MOLLWEIDE   25     Mollweide
     INT MOLLW   26     Interrupted Mollweide
     HAMMER      27     Hammer
     WAGNER IV   28     Wagner IV
     WAGNER VII  29     Wagner VII
     OBLEQA      30     Oblated Equal Area

inunit (input, long)

Unit code for coordinates. Valid unit codes are:

      = 0: radians (default)
      = 1: feet
      = 2: meters 
      = 3: seconds of arc
      = 4: degrees of arc 
      = 5: packed DMS (DDDMMMSSS.SS)

inzone (input, long)

Zone for UTM and State Plane projection systems. Refer to Table C for the coverage of UTM zones and to Table B for state plane zone codes. For the Southern Hemisphere UTM, use a negative zone code.

indatum (input, long)

Input datum code. If the value is less than 100, it represents a spheroid which is defined by a semimajor and semiminor (or eccentricity squred) axis. If the value is greater than 100 it also represents a datum. Datums are defined by a spheroid and x, y, and z shifts.

If the input projection (inproj) is not GEO, UTM, or SPCS, and the inparm array elements 1 and 2 contain values, they must match the values defining the spheroid represented in indatum. The input datum indatum and the output datum outdatum must both be either above 100 or below 100 for a transformation to occur. A fatal error will result if not.

Supported spheroids include:

					      Axes in Meters
     Code    Spheroid Name	        Semi-Major      Semi-Minor

       0     Clarke 1866 (default)      6378206.4	6356583.8
       1     Clarke 1880		6378249.145	6356514.86955
       2     Bessel			6377397.155	6356078.9628
       3     International 1967		6378157.5	6356772.2
       4     International 1909		6378388.0	6356911.94613
       5     WGS 72			6378135.0	6356750.519915
       6     Everest			6377276.3452	6356075.4133
       7     WGS 66			6378145.0	6356759.769356
       8     GRS 1980			6378137.0	6356752.31414
       9     Airy			6377563.396	6356256.91
      10     Modified Everest		6377304.063	6356103.039
      11     Modified Airy		6377340.189	6356036.143
      12     WGS 84			6378137.0	6356752.314245
      13     Southeast Asia		6378155.0	6356773.3205
      14     Australian National	6378160.0	6356774.719
      15     Krassovsky			6378245.0	6356863.0188
      16     Hough			6378270.0	6356794.343479
      17     Mercury 1960		6378166.0	6356784.283666
      18     Modified Mercury 1968	6378150.0	6356768.337303
      19     Sphere			6370997.0	6370997.0
Here is a list of supported datums. A Datum Query tool is also available.

inparm (input, double, length (15))

Array of fifteen projection parameters. These parameters define each map projection. See Table A for the definition of the fields for each projection.

outproj (output, long)

Defines the output projection system. Refer to the inproj parameter description for a list of valid projection system codes.

outunit (output, long)

Unit code for output coordinates. Refer to inunit for a list of valid unit codes.

outzone (output, long)

Zone for UTM and State Plane projection systems. Refer to Table C for the coverage of UTM zones and to Table B for state plane zone codes.

outdatum (output, long)

Output datum code. Refer to the indatum parameter description for additional information on valid datum codes and their application.

outparm (output, double, length (15))

Array of fifteen projection parameters. These parameters are required to define each map projection. See Table A for the definition of the fields for each projection.

prtprm (input, long, length (2))

Report destination flags. Fields are as follows:

     prtprm[GEO_TERM]     Print to terminal?     TRUE or FALSE
     prtprm[GEO_FILE]     Print to file?         TRUE or FALSE

fname (input, char)

Name of disk or printer file. The file must be closed before the call to c_transinit(). c_transinit() will open the file, write to it, and close it. Filenames are those used with the FILEUTIL report utility. This parameter is NULL if a print file is not used.

DESCRIPTION

This function initializes the parameters used to transform coordinate pairs from map projection, unit, and/or datum to another. It initializes by performing initial parameter checking, packing and comparing earth datum codes, and reporting projection parameters to the user. The primary workhorse for the projection conversion routines of this package is the U.S. Geological Survey's General Cartographic Transformat ion 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.

c_trans() is called to perform the actual transformation of coordinate pairs.

RETURN VALUE

c_transinit() returns

     E_SUCC (0)  --> successful completion
     E_FAIL (-1) --> coordinate transformation parameters invalid

REFERENCES

The following documents have been used as references for the c_transinit() utility. Also, the tables (A, B, C) referenced in the parameter descriptions in c_transinit() are included.

Clarie, Charles N., State Plane Coordinates by Automatic Data Processing, Publication 62-4, U.S. Department of Commerce, Environmental Science Services Administration, Coast and Geodetic Survey, United States Government Printing Office, Washington D.C., 1973

Software Documentation for GCTP General Cartographic Transformation Package: National Mapping Program Technical Instructions,, U.S. Geological Survey National Mapping Division, May 1982.

Snyder, John P., Map Projections--A Working Manual, U.S. Geological Survey Professional Paper 1395 (Supersedes USGS Bulletin 1532), United States Government Printing Office, Washington D.C., 1987.

Snyder, John P., New Equal-Area Map Projections for Noncircular Regions, The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.

Snyder, John P. and Voxland, Philip M., An Album of Map Projections, U.S. Geological Survey Professional Paper 1453, United States Government Printing Office, Washington D.C., 1989.

Table A: Parameters Required for Definition of Map Projections

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

Table C: UTM Zone Codes, Locations and Central Meridians