org.iu.gps
Class COORD

java.lang.Object
  |
  +--org.iu.gps.COORD

public class COORD
extends java.lang.Object

The COORD class encapsulates all methods related to earth coordinate transformations. It can transform earth coordinates between a huge number of earth dates, and it can transform from / to GaussKrueger coordinates.


Field Summary
protected  int datum
           
static DATUM[] gDatum
          List of geodetic earth dates.
static ELLIPSOID[] gEllipsoid
          List of geodetic earth ellipsoids.
 
Constructor Summary
COORD(int _datum)
          Constructor for the COORD object
 
Method Summary
protected  XY convertFromTM(double x, double y, double lat0, double lon0, double k0)
          Performs re-projection from TM.
static XY convertToGaussKrueger(double lat, double lon)
          Converts latitude / longitude (WGS84) coordinates to German GaussKrueger coordinates.
static XY convertToGaussKrueger(double lat, double lon, int datum)
          Converts latitude / longitude (rel. to given datum) coordinates to German GaussKrueger coordinates.
static XY convertToGK(double lat, double lon)
          Converts lat/long to Gauss-Krueger.
static XY convertToLatLong(double x, double y)
          Converts GaussKrueger coordinates to latitude / longitude relative to the WGS84 earth datum.
static XY convertToLatLong(double x, double y, int d)
          Converts to latitude / longitude using the given earth datum.
static XY convertToLL(double x, double y)
          Converts Gauss-Krueger to lat/long.
protected  XY convertToTM(double lat, double lon, double lat0, double lon0, double k0)
          Performs a transmercator (TM) projection.
protected  XY datumParams(int datum)
          Retrieve earth datum parameters for given ID.
protected  double M(double phi, double a, double es)
          Calculate M.
static void main(java.lang.String[] args)
          The main program for the COORD class
static XY translate(boolean fromWGS84, double latitude, double longitude, int datumID)
          Method to convert coordinates from/to WGS84 coordinates.
static XY translate(int fromID, int toID, double latitude, double longitude)
          Translate coordinates related to one earth datum (fromID) to another earth datum (toID).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gEllipsoid

public static final ELLIPSOID[] gEllipsoid
List of geodetic earth ellipsoids.

gDatum

public static final DATUM[] gDatum
List of geodetic earth dates.

datum

protected int datum
Constructor Detail

COORD

public COORD(int _datum)
Constructor for the COORD object
Parameters:
_datum - Index into gDatum table of datum to use.
Method Detail

translate

public static XY translate(int fromID,
                           int toID,
                           double latitude,
                           double longitude)
Translate coordinates related to one earth datum (fromID) to another earth datum (toID). The IDs are indeces into gDatum.
Parameters:
fromID - earth datum to translate from
toID - earth datum to translate to
latitude - latitude of coord. to translate
longitude - longitude of coord. to translate
Returns:
converted coordinate in XY struct

translate

public static XY translate(boolean fromWGS84,
                           double latitude,
                           double longitude,
                           int datumID)
Method to convert coordinates from/to WGS84 coordinates. ID is an index into gDatum.
Parameters:
fromWGS84 - Parameter
latitude - Parameter
longitude - Parameter
datumID - Parameter
Returns:
Returned Value

convertToGaussKrueger

public static XY convertToGaussKrueger(double lat,
                                       double lon,
                                       int datum)
Converts latitude / longitude (rel. to given datum) coordinates to German GaussKrueger coordinates.
Parameters:
lat - Latitude
lon - Longitude
datum - Datum of the given coord.
Returns:
Converted GaussKrueger coordinates

convertToGaussKrueger

public static XY convertToGaussKrueger(double lat,
                                       double lon)
Converts latitude / longitude (WGS84) coordinates to German GaussKrueger coordinates.
Parameters:
lat - Latitude
lon - Longitude
Returns:
Converted GaussKrueger coordinates

convertToLatLong

public static XY convertToLatLong(double x,
                                  double y)
Converts GaussKrueger coordinates to latitude / longitude relative to the WGS84 earth datum.
Parameters:
x - Parameter
y - Parameter
Returns:
Returned Value

convertToLatLong

public static XY convertToLatLong(double x,
                                  double y,
                                  int d)
Converts to latitude / longitude using the given earth datum.
Parameters:
x - GaussKrueger X.
y - GaussKrueger Y.
d - Earth datum to use for resulting coordinates.
Returns:
Converted coordinates.

main

public static void main(java.lang.String[] args)
The main program for the COORD class
Parameters:
args - The command line arguments

convertToLL

public static XY convertToLL(double x,
                             double y)
Converts Gauss-Krueger to lat/long.
Parameters:
x - Parameter
y - Parameter
Returns:
Returned Value

convertToGK

public static XY convertToGK(double lat,
                             double lon)
Converts lat/long to Gauss-Krueger.
Parameters:
lat - Parameter
lon - Parameter
Returns:
Returned Value

datumParams

protected XY datumParams(int datum)
Retrieve earth datum parameters for given ID.
Parameters:
datum - Parameter
Returns:
Returned Value

convertToTM

protected XY convertToTM(double lat,
                         double lon,
                         double lat0,
                         double lon0,
                         double k0)
Performs a transmercator (TM) projection.
Parameters:
lat - Parameter
lon - Parameter
lat0 - Parameter
lon0 - Parameter
k0 - Parameter
Returns:
Returned Value

convertFromTM

protected XY convertFromTM(double x,
                           double y,
                           double lat0,
                           double lon0,
                           double k0)
Performs re-projection from TM.
Parameters:
x - Parameter
y - Parameter
lat0 - Parameter
lon0 - Parameter
k0 - Parameter
Returns:
Returned Value

M

protected double M(double phi,
                   double a,
                   double es)
Calculate M.
Parameters:
phi - Parameter
a - Parameter
es - Parameter
Returns:
Returned Value