Package gov.nasa.worldwind.geom.coords
Class UPSCoordConverter
- java.lang.Object
-
- gov.nasa.worldwind.geom.coords.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
-
-
Field Summary
Fields Modifier and Type Field Description static int
UPS_EASTING_ERROR
static int
UPS_HEMISPHERE_ERROR
static int
UPS_NO_ERROR
static int
UPS_NORTHING_ERROR
-
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.
-
-
-
Field Detail
-
UPS_NO_ERROR
public static final int UPS_NO_ERROR
- See Also:
- Constant Field Values
-
UPS_HEMISPHERE_ERROR
public static final int UPS_HEMISPHERE_ERROR
- See Also:
- Constant Field Values
-
UPS_EASTING_ERROR
public static final int UPS_EASTING_ERROR
- See Also:
- Constant Field Values
-
UPS_NORTHING_ERROR
public static final int UPS_NORTHING_ERROR
- See Also:
- Constant Field Values
-
-
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 metersf
- 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 radianslongitude
- 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
orAVKey.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, eitherAVKey.NORTH
orAVKey.SOUTH
.Easting
- Easting/X in metersNorthing
- Northing/Y in meters- Returns:
- error code
-
getLatitude
public double getLatitude()
- Returns:
- Latitude in radians.
-
getLongitude
public double getLongitude()
- Returns:
- Longitude in radians.
-
-