Class UTM


  • public class UTM
    extends Object
    Universal Transverse Mercator Projection
    Author:
    wnewman, osbornb
    • Constructor Detail

      • UTM

        public UTM​(int zone,
                   Hemisphere hemisphere,
                   double easting,
                   double northing)
        Constructor
        Parameters:
        zone - zone number
        hemisphere - hemisphere
        easting - easting
        northing - northing
    • Method Detail

      • create

        public static UTM create​(int zone,
                                 Hemisphere hemisphere,
                                 double easting,
                                 double northing)
        Create
        Parameters:
        zone - zone number
        hemisphere - hemisphere
        easting - easting
        northing - 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 number
        hemisphere - hemisphere
        easting - easting
        northing - 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 - point
        zone - 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 - coordinate
        zone - zone number
        hemisphere - hemisphere
        Returns:
        UTM