Sample Code


Sample Code:

Sample programs are provided below to utilize each conversion program.  Recall that the conversion classes are static and do not need to be instantiated directly (via the new keyword)

The basic sequence for a simple, point to point conversion, is illustrated as follows for Geodetic to Geocentric:
Step# Description Code
1. Create Source Point Gdc_Coord_3d gdc = new Gdc_Coord_3d(45,-90,1000)
2. Create Destination Point Gcc_Coord_3d gcc = new Gcc_Coord_3d()
3. Init the conversion to the user supplied reference ellipsoid. Gdc_To_Gcc_Converter.Init(new WE_Ellipsoid())
4. Convert the point. Gdc_To_Gcc_Converter.Convert(gdc,gcc)

Test Programs:

Note that if you are unable to view the files directly (i.e. your browser or system doesn't know what to do with .java files) then try saving the link to disk and opening it with a text editor.