Package gov.nasa.worldwind.geom.coords
Class UTMCoord
- java.lang.Object
-
- gov.nasa.worldwind.geom.coords.UTMCoord
-
public class UTMCoord extends java.lang.Object
This immutable class holds a set of UTM coordinates along with it's corresponding latitude and longitude.
-
-
Constructor Summary
Constructors Constructor Description UTMCoord(double latitude, double longitude, int zone, Hemisphere hemisphere, double easting, double northing)
Create an arbitrary set of UTM coordinates with the given values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UTMCoord
fromLatLon(double latitude, double longitude)
Create a set of UTM coordinates from a pair of latitude and longitude for the givenGlobe
.static UTMCoord
fromUTM(int zone, Hemisphere hemisphere, double easting, double northing)
Create a set of UTM coordinates for the givenGlobe
.double
getEasting()
Hemisphere
getHemisphere()
double
getLatitude()
double
getLongitude()
double
getNorthing()
int
getZone()
java.lang.String
toString()
-
-
-
Constructor Detail
-
UTMCoord
public UTMCoord(double latitude, double longitude, int zone, Hemisphere hemisphere, double easting, double northing)
Create an arbitrary set of UTM coordinates with the given values.- Parameters:
latitude
- the latitudedouble
.longitude
- the longitudedouble
.zone
- the UTM zone - 1 to 60.hemisphere
- the hemisphere, eitherHemisphere.N
ofHemisphere.S
.easting
- the easting distance in metersnorthing
- the northing distance in meters.- Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null.
-
-
Method Detail
-
fromLatLon
public static UTMCoord fromLatLon(double latitude, double longitude)
Create a set of UTM coordinates from a pair of latitude and longitude for the givenGlobe
.- Parameters:
latitude
- the latitudedouble
.longitude
- the longitudedouble
.- Returns:
- the corresponding
UTMCoord
. - Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null, or the conversion to UTM coordinates fails.
-
fromUTM
public static UTMCoord fromUTM(int zone, Hemisphere hemisphere, double easting, double northing)
Create a set of UTM coordinates for the givenGlobe
.- Parameters:
zone
- the UTM zone - 1 to 60.hemisphere
- the hemisphere, eitherHemisphere.N
ofHemisphere.S
.easting
- the easting distance in metersnorthing
- the northing distance in meters.- Returns:
- the corresponding
UTMCoord
. - Throws:
java.lang.IllegalArgumentException
- if the conversion to UTM coordinates fails.
-
getLatitude
public double getLatitude()
-
getLongitude
public double getLongitude()
-
getZone
public int getZone()
-
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
-
-