Package mil.nga.mgrs.utm
Class UTM
- java.lang.Object
-
- mil.nga.mgrs.utm.UTM
-
public class UTM extends Object
Universal Transverse Mercator Projection- Author:
- wnewman, osbornb
-
-
Constructor Summary
Constructors Constructor Description UTM(int zone, Hemisphere hemisphere, double easting, double northing)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UTM
create(int zone, Hemisphere hemisphere, double easting, double northing)
CreateString
format()
Format to a UTM stringstatic UTM
from(Point point)
Create from a pointstatic UTM
from(Point point, int zone)
Create from a point and zone numberstatic UTM
from(Point point, int zone, Hemisphere hemisphere)
Create from a coordinate, zone number, and hemispheredouble
getEasting()
Get the eastingHemisphere
getHemisphere()
Get the hemispheredouble
getNorthing()
Get the northingint
getZone()
Get the zone numberstatic boolean
isUTM(String utm)
Return whether the given string is valid UTM stringstatic UTM
parse(String utm)
Parse a UTM value (Zone N|S Easting Northing)static Point
point(int zone, Hemisphere hemisphere, double easting, double northing)
Create a point from the UTM attributesMGRS
toMGRS()
Convert to a MGRS coordinatePoint
toPoint()
Convert to a pointString
toString()
-
-
-
Constructor Detail
-
UTM
public UTM(int zone, Hemisphere hemisphere, double easting, double northing)
Constructor- Parameters:
zone
- zone numberhemisphere
- hemisphereeasting
- eastingnorthing
- northing
-
-
Method Detail
-
create
public static UTM create(int zone, Hemisphere hemisphere, double easting, double northing)
Create- Parameters:
zone
- zone numberhemisphere
- hemisphereeasting
- eastingnorthing
- northing- Returns:
- UTM
-
point
public static Point point(int zone, Hemisphere hemisphere, double easting, double northing)
Create a point from the UTM attributes- Parameters:
zone
- zone numberhemisphere
- hemisphereeasting
- eastingnorthing
- northing- Returns:
- point
-
getZone
public int getZone()
Get the zone number- Returns:
- zone number
-
getHemisphere
public Hemisphere getHemisphere()
Get the hemisphere- Returns:
- hemisphere
-
getEasting
public double getEasting()
Get the easting- Returns:
- easting
-
getNorthing
public double getNorthing()
Get the northing- Returns:
- northing
-
toPoint
public Point toPoint()
Convert to a point- Returns:
- point
-
toMGRS
public MGRS toMGRS()
Convert to a MGRS coordinate- Returns:
- MGRS
-
format
public String format()
Format to a UTM string- Returns:
- UTM string
-
isUTM
public static boolean isUTM(String utm)
Return whether the given string is valid UTM string- Parameters:
utm
- potential UTM string- Returns:
- true if UTM string is valid, false otherwise
-
parse
public static UTM parse(String utm) throws ParseException
Parse a UTM value (Zone N|S Easting Northing)- Parameters:
utm
- UTM value- Returns:
- UTM
- Throws:
ParseException
- upon failure to parse UTM value
-
from
public static UTM from(Point point)
Create from a point- Parameters:
point
- point- Returns:
- UTM
-
from
public static UTM from(Point point, int zone)
Create from a point and zone number- Parameters:
point
- pointzone
- zone number- Returns:
- UTM
-
from
public static UTM from(Point point, int zone, Hemisphere hemisphere)
Create from a coordinate, zone number, and hemisphere- Parameters:
point
- coordinatezone
- zone numberhemisphere
- hemisphere- Returns:
- UTM
-
-