package dk.thoerup.datumconversion; public class test { static void test() { double Lat; double Long; double UTMEasting = 711375.0; double UTMNorthing = 6190309.0; String UTMZone = "32N"; int RefEllipsoid = 23;//WGS-84. See list with file "LatLong- UTM conversion.cpp" for id numbers Ll ll = DatumConverter.UTMtoLL(RefEllipsoid, new Utm(UTMNorthing, UTMEasting, UTMZone) ); System.out.println( "Calculated Lat, Long position(Lat, Long): " + (float)ll.lattitude + "," + (float)ll.longitude + "\n\n"); } public static void main(String [] args) { test(); double Lat = 47.37816667; double Long = 8.23250000; double UTMNorthing; double UTMEasting; double SwissNorthing; double SwissEasting; String UTMZone; int RefEllipsoid = 23;//WGS-84. See list with file "LatLong- UTM conversion.cpp" for id numbers System.out.println( "Starting position(Lat, Long): " + Lat + " " + Long +"\n"); Utm utm = DatumConverter.LLtoUTM(RefEllipsoid, new Ll(Lat, Long)); UTMNorthing = utm.northing; UTMEasting = utm.easting; UTMZone = utm.utmZone; System.out.println( "Calculated UTM position(Northing, Easting, Zone): "); System.out.println( "" + UTMNorthing + " " + UTMEasting ); System.out.println(" " + UTMZone +"\n"); Ll ll = DatumConverter.UTMtoLL(RefEllipsoid, new Utm(UTMNorthing, UTMEasting, UTMZone)); Lat = ll.lattitude; Long = ll.longitude; System.out.println("Calculated Lat, Long position(Lat, Long): " + Lat + " " + Long + "\n\n"); Swiss swiss = DatumConverter.LLtoSwissGrid( Lat, Long); System.out.println("Calculated Swiss Grid position(Northing, Easting): "); System.out.println("" + swiss.Northing + " " + swiss.Easting + "\n"); } }