Design Document for C_TRANS

C_TRANS

AUTHOR: Jenn Willems

Functional Summary:

Converts coordinates from one datum, projection, and/or unit to another. C_TRANSINIT must be called pror to running this function.

Comments:

C_TRANS will replace C_PROJ as a support to do the conversions.

Background:

C_PROJ used GCTP to convert coordinates from one projection and/or unit to another. The functionality was needed to convert coordinates from one datum to another. The algorithms used to do the datum conversions are from the function DATUMCHG wich was written by Dan Steinwand. The output was tested by running the same values through NIMA's DTCC4.

Requirements:

1. The current functionality of C_PROJ must still exist.
2. Need capability to convert from UTM to another projection with any spheroid.
3. Must be able to convert from one datum to another. 
4. The datum needs to be represented in the ddr, while still being able to use 
   old ddrs.
5. NADCON should be used for conversion from NAD27 to NAD83.  The Moldensky 
   equations can be used for all other conversions.
6. If NADCON errors when a point is out of its range, the Molodensky equations 
   should be used to convert the point.

Scope/Limitations:

1. The datum value in the ddr must represent a datum value.  The datum value
   cannot be assumed by the software.
2. The spheroids the datum use must be supported spheroids by GCTPC.

Overall design:

Flow diagram:


Algorithm:

TRANS:
Swap x and y (and negate y) for SOM

Convert the coordinates to geographic using GCTP:

Do datum conversion:

Convert back to output coordinate:

If SOM, swap x and y back.

INPROJ
Input: Input projection code.

INUNIT
Input: Input projection unit code.

OUTPROJ
Input: Output projection code.

OUTUNIT
Input: Output projection unit code.

INX
Input: Input X projection coordinate.

INY
Input: Input Y projection coordinate.

OUTX
Output: Output X projection coordinate.

OUTY
Output: Output Y projection coordinate.

RETURN VALUE(S):

Error returned from coordinate conversion
Error returned from datum conversion
Datum flag does not represent a conversion
Could not convert from Degrees to DMS
Could not convert to Degrees
Error returned from unit factor
Error returned from inverse transformation
Error returned from forward transformation

Testing criteria:

1. Run the same tests used to test the algorithms and verify results.
2. Validate that all projection conversions are the same as with c_proj.
3. Check to see that UTM can now be converted to another projection with 
   any spheroid and back.
4. Validate that converting from one datum to another and back yields the 
   same data.
5. Verify that using trancoord-nad, and converting from nad27 to nad83 yeilds 
   the same results.
6. Check combinations of non-nad datums to nad datums.
7. Tested that values outside NADCON's range were converted properly using 
   molodensky transformations.