Class UTM


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

      Constructors 
      Constructor Description
      UTM​(int zone, mil.nga.grid.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, mil.nga.grid.Hemisphere hemisphere, double easting, double northing)
      Create
      String format()
      Format to a UTM string
      static UTM from​(mil.nga.grid.features.Point point)
      Create from a point
      static UTM from​(mil.nga.grid.features.Point point, int zone)
      Create from a point and zone number
      static UTM from​(mil.nga.grid.features.Point point, int zone, mil.nga.grid.Hemisphere hemisphere)
      Create from a coordinate, zone number, and hemisphere
      double getEasting()
      Get the easting
      mil.nga.grid.Hemisphere getHemisphere()
      Get the hemisphere
      double getNorthing()
      Get the northing
      int getZone()
      Get the zone number
      static boolean isUTM​(String utm)
      Return whether the given string is valid UTM string
      static UTM parse​(String utm)
      Parse a UTM value (Zone N|S Easting Northing)
      static mil.nga.grid.features.Point point​(int zone, mil.nga.grid.Hemisphere hemisphere, double easting, double northing)
      Create a point from the UTM attributes
      MGRS toMGRS()
      Convert to a MGRS coordinate
      mil.nga.grid.features.Point toPoint()
      Convert to a point
      String toString()
    • Constructor Detail

      • UTM

        public UTM​(int zone,
                   mil.nga.grid.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,
                                 mil.nga.grid.Hemisphere hemisphere,
                                 double easting,
                                 double northing)
        Create
        Parameters:
        zone - zone number
        hemisphere - hemisphere
        easting - easting
        northing - northing
        Returns:
        UTM
      • point

        public static mil.nga.grid.features.Point point​(int zone,
                                                        mil.nga.grid.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 mil.nga.grid.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 mil.nga.grid.features.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​(mil.nga.grid.features.Point point)
        Create from a point
        Parameters:
        point - point
        Returns:
        UTM
      • from

        public static UTM from​(mil.nga.grid.features.Point point,
                               int zone)
        Create from a point and zone number
        Parameters:
        point - point
        zone - zone number
        Returns:
        UTM
      • from

        public static UTM from​(mil.nga.grid.features.Point point,
                               int zone,
                               mil.nga.grid.Hemisphere hemisphere)
        Create from a coordinate, zone number, and hemisphere
        Parameters:
        point - coordinate
        zone - zone number
        hemisphere - hemisphere
        Returns:
        UTM