NASA World Wind

gov.nasa.worldwind.geom.coords
Class UPSCoord

java.lang.Object
  extended by gov.nasa.worldwind.geom.coords.UPSCoord

public class UPSCoord
extends Object

This immutable class holds a set of UPS coordinates along with it's corresponding latitude and longitude.


Constructor Summary
UPSCoord(Angle latitude, Angle longitude, char hemisphere, double easting, double northing)
          Create an arbitrary set of UPS coordinates with the given values.
 
Method Summary
static UPSCoord fromLatLon(Angle latitude, Angle longitude)
          Create a set of UPS coordinates from a pair of latitude and longitude for a WGS84 globe.
static UPSCoord fromLatLon(Angle latitude, Angle longitude, Globe globe)
          Create a set of UPS coordinates from a pair of latitude and longitude for the given Globe.
static UPSCoord fromUPS(char hemisphere, double easting, double northing, Globe globe)
          Create a set of UPS coordinates for the given Globe.
static UPSCoord fromUTM(char hemisphere, double easting, double northing)
          Create a set of UPS coordinates for a WGS84 globe.
 double getEasting()
           
 char getHemisphere()
           
 Angle getLatitude()
           
 Angle getLongitude()
           
 double getNorthing()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UPSCoord

public UPSCoord(Angle latitude,
                Angle longitude,
                char hemisphere,
                double easting,
                double northing)
Create an arbitrary set of UPS coordinates with the given values.

Parameters:
latitude - the latitude Angle.
longitude - the longitude Angle.
hemisphere - the hemisphere 'N' or 'S'.
easting - the easting distance in meters
northing - the northing distance in meters.
Throws:
IllegalArgumentException - if latitude or longitude is null.
Method Detail

fromLatLon

public static UPSCoord fromLatLon(Angle latitude,
                                  Angle longitude)
Create a set of UPS coordinates from a pair of latitude and longitude for a WGS84 globe.

Parameters:
latitude - the latitude Angle.
longitude - the longitude Angle.
Returns:
the corresponding UPSCoord.
Throws:
IllegalArgumentException - if latitude or longitude is null, or the conversion to UPS coordinates fails.

fromLatLon

public static UPSCoord fromLatLon(Angle latitude,
                                  Angle longitude,
                                  Globe globe)
Create a set of UPS coordinates from a pair of latitude and longitude for the given Globe.

Parameters:
latitude - the latitude Angle.
longitude - the longitude Angle.
globe - the Globe - can be null (will use WGS84).
Returns:
the corresponding UPSCoord.
Throws:
IllegalArgumentException - if latitude or longitude is null, or the conversion to UPS coordinates fails.

fromUPS

public static UPSCoord fromUPS(char hemisphere,
                               double easting,
                               double northing,
                               Globe globe)
Create a set of UPS coordinates for the given Globe.

Parameters:
hemisphere - the hemisphere 'N' or 'S'.
easting - the easting distance in meters
northing - the northing distance in meters.
globe - the Globe - can be null (will use WGS84).
Returns:
the corresponding UPSCoord.
Throws:
IllegalArgumentException - if the conversion to UPS coordinates fails.

fromUTM

public static UPSCoord fromUTM(char hemisphere,
                               double easting,
                               double northing)
Create a set of UPS coordinates for a WGS84 globe.

Parameters:
hemisphere - the hemisphere 'N' or 'S'.
easting - the easting distance in meters
northing - the northing distance in meters.
Returns:
the corresponding UPSCoord.
Throws:
IllegalArgumentException - if the conversion to UPS coordinates fails.

getEasting

public double getEasting()

getHemisphere

public char getHemisphere()

getLatitude

public Angle getLatitude()

getLongitude

public Angle getLongitude()

getNorthing

public double getNorthing()

toString

public String toString()
Overrides:
toString in class Object

NASA World Wind