As already discussed, differences of the order of hundreds of meters
can exist between the coordinates of locations when expressed in
different datums. Mathematically this can be represented by a
translation of the origin of the coordinate system when converting
between one reference ellipsoid and another. Of course the shape and
size of the ellipse also varies between datums. To map between two
datums, a complex mathematical transformation called “Molodensky
Datum Transform” is used. The implementation in XP_GIS is based upon
the Java implementation provided by Chuck Taylor at http://home.hiwaay.net/~taylorc/bookshelf/math-science/geodesy/datum/transform/molodensky/.
This Java implementation is itself based by Peter H. Dana’s
description at http://www.colorado.edu/geography/gcraft/notes/datum/gif/molodens.gif.
The actual implementation of the Molodensky algorithm is implemented
in the helper function called “DatumTransform”. Because the
algorithm is based on transforming to the WGS84 datum, the code
first transforms to this datum (if it is not already WGS8) and then
converts from WGS84 to the final datum.
This XP takes 8 parameters. The first parameter is the latitude in
decimal degrees in the datum to transform from (where west is
considered negative). The second parameter is the latitude in
decimal degrees in the datum to transform from. The third parameter
is the height in metres in the datum to transform from. The fourth
and fifth specify the datum to transform from and the datum to
transform to. These values correspond to the indexes as passed to
XP_GIS_DATUMINFO. Upon return, the final three parameters contain
the longitude, latitude and height of the transformed coordinates.
These are in the same units as the corresponding input parameters.
The above book excerpt is from:
Turbocharge Database Performance with C++ External Procedures
Joseph Gama, P. J. Naughter