Package gov.nasa.worldwind.geom.coords
Class UPSCoord
- java.lang.Object
-
- gov.nasa.worldwind.geom.coords.UPSCoord
-
public class UPSCoord extends java.lang.Object
This immutable class holds a set of UPS coordinates along with it's corresponding latitude and longitude.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 givenGlobe
.static UPSCoord
fromUPS(java.lang.String hemisphere, double easting, double northing, Globe globe)
Create a set of UPS coordinates for the givenGlobe
.static UPSCoord
fromUTM(java.lang.String hemisphere, double easting, double northing)
Create a set of UPS coordinates for a WGS84 globe.double
getEasting()
java.lang.String
getHemisphere()
Angle
getLatitude()
Angle
getLongitude()
double
getNorthing()
java.lang.String
toString()
-
-
-
Constructor Detail
-
UPSCoord
public UPSCoord(Angle latitude, Angle longitude, java.lang.String hemisphere, double easting, double northing)
Create an arbitrary set of UPS coordinates with the given values.- Parameters:
latitude
- the latitudeAngle
.longitude
- the longitudeAngle
.hemisphere
- the hemisphere, eitherAVKey.NORTH
orAVKey.SOUTH
.easting
- the easting distance in metersnorthing
- the northing distance in meters.- Throws:
java.lang.IllegalArgumentException
- iflatitude
,longitude
, orhemisphere
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 latitudeAngle
.longitude
- the longitudeAngle
.- Returns:
- the corresponding
UPSCoord
. - Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
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 givenGlobe
.- Parameters:
latitude
- the latitudeAngle
.longitude
- the longitudeAngle
.globe
- theGlobe
- can be null (will use WGS84).- Returns:
- the corresponding
UPSCoord
. - Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null, or the conversion to UPS coordinates fails.
-
fromUTM
public static UPSCoord fromUTM(java.lang.String hemisphere, double easting, double northing)
Create a set of UPS coordinates for a WGS84 globe.- Parameters:
hemisphere
- the hemisphere, eitherAVKey.NORTH
orAVKey.SOUTH
.easting
- the easting distance in metersnorthing
- the northing distance in meters.- Returns:
- the corresponding
UPSCoord
. - Throws:
java.lang.IllegalArgumentException
- if the conversion to UPS coordinates fails.
-
fromUPS
public static UPSCoord fromUPS(java.lang.String hemisphere, double easting, double northing, Globe globe)
Create a set of UPS coordinates for the givenGlobe
.- Parameters:
hemisphere
- the hemisphere, eitherAVKey.NORTH
orAVKey.SOUTH
.easting
- the easting distance in metersnorthing
- the northing distance in meters.globe
- theGlobe
- can be null (will use WGS84).- Returns:
- the corresponding
UPSCoord
. - Throws:
java.lang.IllegalArgumentException
- if the conversion to UPS coordinates fails.
-
getLatitude
public Angle getLatitude()
-
getLongitude
public Angle getLongitude()
-
getHemisphere
public java.lang.String getHemisphere()
-
getEasting
public double getEasting()
-
getNorthing
public double getNorthing()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-