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(Angle latitude, Angle longitude, int zone, java.lang.String hemisphere, double easting, double northing)
Create an arbitrary set of UTM coordinates with the given values.UTMCoord(Angle latitude, Angle longitude, int zone, java.lang.String hemisphere, double easting, double northing, Angle centralMeridian)
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(Angle latitude, Angle longitude)
Create a set of UTM coordinates from a pair of latitude and longitude for a WGS84 globe.static UTMCoord
fromLatLon(Angle latitude, Angle longitude, Globe globe)
Create a set of UTM coordinates from a pair of latitude and longitude for the givenGlobe
.static UTMCoord
fromLatLon(Angle latitude, Angle longitude, java.lang.String datum)
static UTMCoord
fromUTM(int zone, java.lang.String hemisphere, double easting, double northing)
Create a set of UTM coordinates for a WGS84 globe.static UTMCoord
fromUTM(int zone, java.lang.String hemisphere, double easting, double northing, Globe globe)
Create a set of UTM coordinates for the givenGlobe
.Angle
getCentralMeridian()
double
getEasting()
java.lang.String
getHemisphere()
Angle
getLatitude()
Angle
getLongitude()
double
getNorthing()
int
getZone()
static LatLon
locationFromUTMCoord(int zone, java.lang.String hemisphere, double easting, double northing, Globe globe)
Convenience method for converting a UTM coordinate to a geographic location.java.lang.String
toString()
-
-
-
Constructor Detail
-
UTMCoord
public UTMCoord(Angle latitude, Angle longitude, int zone, java.lang.String hemisphere, double easting, double northing)
Create an arbitrary set of UTM coordinates with the given values.- Parameters:
latitude
- the latitudeAngle
.longitude
- the longitudeAngle
.zone
- the UTM zone - 1 to 60.hemisphere
- the hemisphere, eitherAVKey.NORTH
orAVKey.SOUTH
.easting
- the easting distance in metersnorthing
- the northing distance in meters.- Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null.
-
UTMCoord
public UTMCoord(Angle latitude, Angle longitude, int zone, java.lang.String hemisphere, double easting, double northing, Angle centralMeridian)
Create an arbitrary set of UTM coordinates with the given values.- Parameters:
latitude
- the latitudeAngle
.longitude
- the longitudeAngle
.zone
- the UTM zone - 1 to 60.hemisphere
- the hemisphere, eitherAVKey.NORTH
orAVKey.SOUTH
.easting
- the easting distance in metersnorthing
- the northing distance in meters.centralMeridian
- the cntral meridianAngle
.- Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null.
-
-
Method Detail
-
fromLatLon
public static UTMCoord fromLatLon(Angle latitude, Angle longitude)
Create a set of UTM coordinates from a pair of latitude and longitude for a WGS84 globe.- Parameters:
latitude
- the latitudeAngle
.longitude
- the longitudeAngle
.- Returns:
- the corresponding
UTMCoord
. - Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null, or the conversion to UTM coordinates fails.
-
fromLatLon
public static UTMCoord fromLatLon(Angle latitude, Angle longitude, Globe globe)
Create a set of UTM 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
UTMCoord
. - Throws:
java.lang.IllegalArgumentException
- iflatitude
orlongitude
is null, or the conversion to UTM coordinates fails.
-
fromLatLon
public static UTMCoord fromLatLon(Angle latitude, Angle longitude, java.lang.String datum)
-
fromUTM
public static UTMCoord fromUTM(int zone, java.lang.String hemisphere, double easting, double northing)
Create a set of UTM coordinates for a WGS84 globe.- Parameters:
zone
- the UTM zone - 1 to 60.hemisphere
- the hemisphere, eitherAVKey.NORTH
orAVKey.SOUTH
.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.
-
fromUTM
public static UTMCoord fromUTM(int zone, java.lang.String hemisphere, double easting, double northing, Globe globe)
Create a set of UTM coordinates for the givenGlobe
.- Parameters:
zone
- the UTM zone - 1 to 60.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
UTMCoord
. - Throws:
java.lang.IllegalArgumentException
- if the conversion to UTM coordinates fails.
-
locationFromUTMCoord
public static LatLon locationFromUTMCoord(int zone, java.lang.String hemisphere, double easting, double northing, Globe globe)
Convenience method for converting a UTM coordinate to a geographic location.- Parameters:
zone
- the UTM zone: 1 to 60.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 geographic location corresponding to the specified UTM coordinate.
-
getCentralMeridian
public Angle getCentralMeridian()
-
getLatitude
public Angle getLatitude()
-
getLongitude
public Angle getLongitude()
-
getZone
public int getZone()
-
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
-
-