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 UTMcreate(int zone, Hemisphere hemisphere, double easting, double northing)CreateStringformat()Format to a UTM stringstatic UTMfrom(Point point)Create from a pointstatic UTMfrom(Point point, int zone)Create from a point and zone numberstatic UTMfrom(Point point, int zone, Hemisphere hemisphere)Create from a coordinate, zone number, and hemispheredoublegetEasting()Get the eastingHemispheregetHemisphere()Get the hemispheredoublegetNorthing()Get the northingintgetZone()Get the zone numberstatic booleanisUTM(String utm)Return whether the given string is valid UTM stringstatic UTMparse(String utm)Parse a UTM value (Zone N|S Easting Northing)static Pointpoint(int zone, Hemisphere hemisphere, double easting, double northing)Create a point from the UTM attributesMGRStoMGRS()Convert to a MGRS coordinatePointtoPoint()Convert to a pointStringtoString()
-
-
-
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
-
-