Package gov.nasa.worldwind.geom.coords
Class UPSCoord
- java.lang.Object
-
- gov.nasa.worldwind.geom.coords.UPSCoord
-
public class UPSCoord extends java.lang.ObjectThis 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 UPSCoordfromLatLon(Angle latitude, Angle longitude)Create a set of UPS coordinates from a pair of latitude and longitude for a WGS84 globe.static UPSCoordfromLatLon(Angle latitude, Angle longitude, Globe globe)Create a set of UPS coordinates from a pair of latitude and longitude for the givenGlobe.static UPSCoordfromUPS(java.lang.String hemisphere, double easting, double northing, Globe globe)Create a set of UPS coordinates for the givenGlobe.static UPSCoordfromUTM(java.lang.String hemisphere, double easting, double northing)Create a set of UPS coordinates for a WGS84 globe.doublegetEasting()java.lang.StringgetHemisphere()AnglegetLatitude()AnglegetLongitude()doublegetNorthing()java.lang.StringtoString()
-
-
-
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.NORTHorAVKey.SOUTH.easting- the easting distance in metersnorthing- the northing distance in meters.- Throws:
java.lang.IllegalArgumentException- iflatitude,longitude, orhemisphereis 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- iflatitudeorlongitudeis 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- iflatitudeorlongitudeis 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.NORTHorAVKey.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.NORTHorAVKey.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:
toStringin classjava.lang.Object
-
-