Class UPSCoordConverter


  • public class UPSCoordConverter
    extends java.lang.Object
    Ported to Java from the NGA GeoTrans ups.c and ups.h code - Feb 12, 2007 4:52:59 PM
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long convertGeodeticToUPS​(double latitude, double longitude)
      The function convertGeodeticToUPS converts geodetic (latitude and longitude) coordinates to UPS (hemisphere, easting, and northing) coordinates, according to the current ellipsoid parameters.
      long convertUPSToGeodetic​(java.lang.String Hemisphere, double Easting, double Northing)
      The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting, and northing) coordinates to geodetic (latitude and longitude) coordinates according to the current ellipsoid parameters.
      double getEasting()  
      java.lang.String getHemisphere()  
      double getLatitude()  
      double getLongitude()  
      double getNorthing()  
      long setUPSParameters​(double a, double f)
      The function SetUPSParameters receives the ellipsoid parameters and sets the corresponding state variables.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setUPSParameters

        public long setUPSParameters​(double a,
                                     double f)
        The function SetUPSParameters receives the ellipsoid parameters and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise UPS_NO_ERROR is returned.
        Parameters:
        a - Semi-major axis of ellipsoid in meters
        f - Flattening of ellipsoid
        Returns:
        error code
      • convertGeodeticToUPS

        public long convertGeodeticToUPS​(double latitude,
                                         double longitude)
        The function convertGeodeticToUPS converts geodetic (latitude and longitude) coordinates to UPS (hemisphere, easting, and northing) coordinates, according to the current ellipsoid parameters. If any errors occur, the error code(s) are returned by the function, otherwide UPS_NO_ERROR is returned.
        Parameters:
        latitude - Latitude in radians
        longitude - Longitude in radians
        Returns:
        error code
      • getEasting

        public double getEasting()
        Returns:
        Easting/X in meters
      • getNorthing

        public double getNorthing()
        Returns:
        Northing/Y in meters
      • getHemisphere

        public java.lang.String getHemisphere()
        Returns:
        Hemisphere, either AVKey.NORTH or AVKey.SOUTH.
      • convertUPSToGeodetic

        public long convertUPSToGeodetic​(java.lang.String Hemisphere,
                                         double Easting,
                                         double Northing)
        The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting, and northing) coordinates to geodetic (latitude and longitude) coordinates according to the current ellipsoid parameters. If any errors occur, the error code(s) are returned by the function, otherwise UPS_NO_ERROR is returned.
        Parameters:
        Hemisphere - Hemisphere, either AVKey.NORTH or AVKey.SOUTH.
        Easting - Easting/X in meters
        Northing - Northing/Y in meters
        Returns:
        error code
      • getLatitude

        public double getLatitude()
        Returns:
        Latitude in radians.
      • getLongitude

        public double getLongitude()
        Returns:
        Longitude in radians.