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.
-
-
Constructor Summary
Constructors Constructor Description UPSCoord(double latitude, double longitude, Hemisphere hemisphere, double easting, double northing)Create an arbitrary set of UPS coordinates with the given values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UPSCoordfromLatLon(double latitude, double longitude)Create a set of UPS coordinates from a pair of latitude and longitude for the givenGlobe.static UPSCoordfromUPS(Hemisphere hemisphere, double easting, double northing)Create a set of UPS coordinates for the givenGlobe.doublegetEasting()HemispheregetHemisphere()doublegetLatitude()doublegetLongitude()doublegetNorthing()java.lang.StringtoString()
-
-
-
Constructor Detail
-
UPSCoord
public UPSCoord(double latitude, double longitude, Hemisphere hemisphere, double easting, double northing)Create an arbitrary set of UPS coordinates with the given values.- Parameters:
latitude- the latitudedouble.longitude- the longitudedouble.hemisphere- the hemisphere, eitherHemisphere.NofHemisphere.S.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(double latitude, double longitude)
Create a set of UPS coordinates from a pair of latitude and longitude for the givenGlobe.- Parameters:
latitude- the latitudedouble.longitude- the longitudedouble.- Returns:
- the corresponding
UPSCoord. - Throws:
java.lang.IllegalArgumentException- iflatitudeorlongitudeis null, or the conversion to UPS coordinates fails.
-
fromUPS
public static UPSCoord fromUPS(Hemisphere hemisphere, double easting, double northing)
Create a set of UPS coordinates for the givenGlobe.- Parameters:
hemisphere- the hemisphere, eitherHemisphere.NofHemisphere.S.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.
-
getLatitude
public double getLatitude()
-
getLongitude
public double getLongitude()
-
getHemisphere
public Hemisphere getHemisphere()
-
getEasting
public double getEasting()
-
getNorthing
public double getNorthing()
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-