NASA World Wind

gov.nasa.worldwind.geom.coords
Class UTMCoord

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

public class UTMCoord
extends Object

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


Constructor Summary
UTMCoord(Angle latitude, Angle longitude, int zone, String hemisphere, double easting, double northing)
          Create an arbitrary set of UTM coordinates with the given values.
UTMCoord(Angle latitude, Angle longitude, int zone, String hemisphere, double easting, double northing, Angle centralMeridian)
          Create an arbitrary set of UTM coordinates with the given values.
 
Method Summary
static UTMCoord fromLatLon(Angle latitude, Angle longitude)
          Create a set of UTM coordinates from a pair of latitude and longitude for a WGS84 globe.
static UTMCoord fromLatLon(Angle latitude, Angle longitude, Globe globe)
          Create a set of UTM coordinates from a pair of latitude and longitude for the given Globe.
static UTMCoord fromLatLon(Angle latitude, Angle longitude, String datum)
           
static UTMCoord fromUTM(int zone, String hemisphere, double easting, double northing)
          Create a set of UTM coordinates for a WGS84 globe.
static UTMCoord fromUTM(int zone, String hemisphere, double easting, double northing, Globe globe)
          Create a set of UTM coordinates for the given Globe.
 Angle getCentralMeridian()
           
 double getEasting()
           
 String getHemisphere()
           
 Angle getLatitude()
           
 Angle getLongitude()
           
 double getNorthing()
           
 int getZone()
           
static LatLon locationFromUTMCoord(int zone, String hemisphere, double easting, double northing, Globe globe)
          Convenience method for converting a UTM coordinate to a geographic location.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UTMCoord

public UTMCoord(Angle latitude,
                Angle longitude,
                int zone,
                String hemisphere,
                double easting,
                double northing)
Create an arbitrary set of UTM coordinates with the given values.

Parameters:
latitude - the latitude Angle.
longitude - the longitude Angle.
zone - the UTM zone - 1 to 60.
hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
easting - the easting distance in meters
northing - the northing distance in meters.
Throws:
IllegalArgumentException - if latitude or longitude is null.

UTMCoord

public UTMCoord(Angle latitude,
                Angle longitude,
                int zone,
                String hemisphere,
                double easting,
                double northing,
                Angle centralMeridian)
Create an arbitrary set of UTM coordinates with the given values.

Parameters:
latitude - the latitude Angle.
longitude - the longitude Angle.
zone - the UTM zone - 1 to 60.
hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
easting - the easting distance in meters
northing - the northing distance in meters.
centralMeridian - the cntral meridian Angle.
Throws:
IllegalArgumentException - if latitude or longitude is null.
Method Detail

fromLatLon

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

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

fromLatLon

public static UTMCoord fromLatLon(Angle latitude,
                                  Angle longitude,
                                  Globe globe)
Create a set of UTM 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 UTMCoord.
Throws:
IllegalArgumentException - if latitude or longitude is null, or the conversion to UTM coordinates fails.

fromLatLon

public static UTMCoord fromLatLon(Angle latitude,
                                  Angle longitude,
                                  String datum)

fromUTM

public static UTMCoord fromUTM(int zone,
                               String hemisphere,
                               double easting,
                               double northing)
Create a set of UTM coordinates for a WGS84 globe.

Parameters:
zone - the UTM zone - 1 to 60.
hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
easting - the easting distance in meters
northing - the northing distance in meters.
Returns:
the corresponding UTMCoord.
Throws:
IllegalArgumentException - if the conversion to UTM coordinates fails.

fromUTM

public static UTMCoord fromUTM(int zone,
                               String hemisphere,
                               double easting,
                               double northing,
                               Globe globe)
Create a set of UTM coordinates for the given Globe.

Parameters:
zone - the UTM zone - 1 to 60.
hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
easting - the easting distance in meters
northing - the northing distance in meters.
globe - the Globe - can be null (will use WGS84).
Returns:
the corresponding UTMCoord.
Throws:
IllegalArgumentException - if the conversion to UTM coordinates fails.

getCentralMeridian

public Angle getCentralMeridian()

getEasting

public double getEasting()

getHemisphere

public String getHemisphere()

getLatitude

public Angle getLatitude()

getLongitude

public Angle getLongitude()

getNorthing

public double getNorthing()

getZone

public int getZone()

locationFromUTMCoord

public static LatLon locationFromUTMCoord(int zone,
                                          String hemisphere,
                                          double easting,
                                          double northing,
                                          Globe globe)
Convenience method for converting a UTM coordinate to a geographic location.

Parameters:
zone - the UTM zone: 1 to 60.
hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
easting - the easting distance in meters
northing - the northing distance in meters.
globe - the Globe. Can be null (will use WGS84).
Returns:
the geographic location corresponding to the specified UTM coordinate.

toString

public String toString()
Overrides:
toString in class Object

NASA World Wind