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 Detail

      • UPSCoord

        public UPSCoord​(double latitude,
                        double longitude,
                        Hemisphere hemisphere,
                        double easting,
                        double northing)
        Create an arbitrary set of UPS coordinates with the given values.
        Parameters:
        latitude - the latitude double.
        longitude - the longitude double.
        hemisphere - the hemisphere, either Hemisphere.N of Hemisphere.S.
        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​(double latitude,
                                          double longitude)
        Create a set of UPS coordinates from a pair of latitude and longitude for the given Globe.
        Parameters:
        latitude - the latitude double.
        longitude - the longitude double.
        Returns:
        the corresponding UPSCoord.
        Throws:
        java.lang.IllegalArgumentException - if latitude or longitude is null, or the conversion to UPS coordinates fails.
      • fromUPS

        public static UPSCoord fromUPS​(Hemisphere hemisphere,
                                       double easting,
                                       double northing)
        Create a set of UPS coordinates for the given Globe.
        Parameters:
        hemisphere - the hemisphere, either Hemisphere.N of Hemisphere.S.
        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.
      • getLatitude

        public double getLatitude()
      • getLongitude

        public double getLongitude()
      • getHemisphere

        public Hemisphere getHemisphere()
      • getEasting

        public double getEasting()
      • getNorthing

        public double getNorthing()
      • toString

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