Class UPSCoord


  • public class UPSCoord
    extends java.lang.Object
    This immutable class holds a set of UPS coordinates along with it's corresponding latitude and longitude.
    • Constructor Summary

      Constructors 
      Constructor Description
      UPSCoord​(Angle latitude, Angle longitude, java.lang.String hemisphere, double easting, double northing)
      Create an arbitrary set of UPS coordinates with the given values.
    • Constructor Detail

      • UPSCoord

        public UPSCoord​(Angle latitude,
                        Angle longitude,
                        java.lang.String hemisphere,
                        double easting,
                        double northing)
        Create an arbitrary set of UPS coordinates with the given values.
        Parameters:
        latitude - the latitude Angle.
        longitude - the longitude Angle.
        hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
        easting - the easting distance in meters
        northing - the northing distance in meters.
        Throws:
        java.lang.IllegalArgumentException - if latitude, longitude, or hemisphere is null.
    • Method Detail

      • fromLatLon

        public static UPSCoord fromLatLon​(Angle latitude,
                                          Angle longitude)
        Create a set of UPS coordinates from a pair of latitude and longitude for a WGS84 globe.
        Parameters:
        latitude - the latitude Angle.
        longitude - the longitude Angle.
        Returns:
        the corresponding UPSCoord.
        Throws:
        java.lang.IllegalArgumentException - if latitude or longitude is null, or the conversion to UPS coordinates fails.
      • fromLatLon

        public static UPSCoord fromLatLon​(Angle latitude,
                                          Angle longitude,
                                          Globe globe)
        Create a set of UPS coordinates from a pair of latitude and longitude for the given Globe.
        Parameters:
        latitude - the latitude Angle.
        longitude - the longitude Angle.
        globe - the Globe - can be null (will use WGS84).
        Returns:
        the corresponding UPSCoord.
        Throws:
        java.lang.IllegalArgumentException - if latitude or longitude is null, or the conversion to UPS coordinates fails.
      • fromUTM

        public static UPSCoord fromUTM​(java.lang.String hemisphere,
                                       double easting,
                                       double northing)
        Create a set of UPS coordinates for a WGS84 globe.
        Parameters:
        hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
        easting - the easting distance in meters
        northing - the northing distance in meters.
        Returns:
        the corresponding UPSCoord.
        Throws:
        java.lang.IllegalArgumentException - if the conversion to UPS coordinates fails.
      • fromUPS

        public static UPSCoord fromUPS​(java.lang.String hemisphere,
                                       double easting,
                                       double northing,
                                       Globe globe)
        Create a set of UPS coordinates for the given Globe.
        Parameters:
        hemisphere - the hemisphere, either AVKey.NORTH or AVKey.SOUTH.
        easting - the easting distance in meters
        northing - the northing distance in meters.
        globe - the Globe - can be null (will use WGS84).
        Returns:
        the corresponding UPSCoord.
        Throws:
        java.lang.IllegalArgumentException - if the conversion to UPS coordinates fails.
      • getLatitude

        public Angle getLatitude()
      • getLongitude

        public Angle getLongitude()
      • getHemisphere

        public java.lang.String getHemisphere()
      • getEasting

        public double getEasting()
      • getNorthing

        public double getNorthing()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object