NASA World Wind

gov.nasa.worldwind.geom.coords
Class UPSConverter

java.lang.Object
  extended by gov.nasa.worldwind.geom.coords.UPSConverter

public class UPSConverter
extends Object

Ported to Java from the NGA GeoTrans ups.c and ups.h code


Field Summary
static int UPS_EASTING_ERROR
           
static int UPS_HEMISPHERE_ERROR
           
static int UPS_NO_ERROR
           
static int UPS_NORTHING_ERROR
           
 
Method Summary
static 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.
static long convertUPSToGeodetic(char 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.
static double getEasting()
           
static char getHemisphere()
           
static double getLatitude()
           
static double getLongitude()
           
static double getNorthing()
           
static 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPS_EASTING_ERROR

public static final int UPS_EASTING_ERROR
See Also:
Constant Field Values

UPS_HEMISPHERE_ERROR

public static final int UPS_HEMISPHERE_ERROR
See Also:
Constant Field Values

UPS_NO_ERROR

public static final int UPS_NO_ERROR
See Also:
Constant Field Values

UPS_NORTHING_ERROR

public static final int UPS_NORTHING_ERROR
See Also:
Constant Field Values
Method Detail

convertGeodeticToUPS

public static 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

convertUPSToGeodetic

public static long convertUPSToGeodetic(char 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 'N' or 'S'
Easting - Easting/X in meters
Northing - Northing/Y in meters
Returns:
error code

getEasting

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

getHemisphere

public static char getHemisphere()
Returns:
Hemisphere 'N' or 'S'

getLatitude

public static double getLatitude()
Returns:
Latitude in radians.

getLongitude

public static double getLongitude()
Returns:
Longitude in radians.

getNorthing

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

SetUPSParameters

public static 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

NASA World Wind