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.
-
-
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 UPSCoord
fromLatLon(double latitude, double longitude)
Create a set of UPS coordinates from a pair of latitude and longitude for the givenGlobe
.static UPSCoord
fromUPS(Hemisphere hemisphere, double easting, double northing)
Create a set of UPS coordinates for the givenGlobe
.double
getEasting()
Hemisphere
getHemisphere()
double
getLatitude()
double
getLongitude()
double
getNorthing()
java.lang.String
toString()
-
-
-
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.N
ofHemisphere.S
.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(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
- iflatitude
orlongitude
is 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.N
ofHemisphere.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:
toString
in classjava.lang.Object
-
-