es.prodevelop.geodetic.utils.conversion
Class ConversionCoords

java.lang.Object
  extended byes.prodevelop.geodetic.utils.conversion.ConversionCoords

public class ConversionCoords
extends java.lang.Object

Uyility class to perform conversions between reference systems.

Author:
vsanjaime, jsanz, jldominguez
See Also:
Elipsoide, GeoUtils

Field Summary
static double DEGREES_PER_RADIAN
           
 
Method Summary
 double dist2gra(double lon, double lat, double dist, Elipsoide elip)
          IMPRECISA Este método calcula un segundo punto a partir de un punto inicial y una distancia.
static double distanciaProj(double lon1, double lat1, double lon2, double lat2, Elipsoide elip)
          This method calculates the projected distance between two points in geodetic coordinates
static double[] geo2mercator(double lon, double lat, Elipsoide elip)
          Converts the given coordinates into the mercator projection
static double[] geo2utm(double lon, double lat, Elipsoide elip)
          This method makes the conversion between geodesic coordinates to projected coordinates in UTM
static double[] geo2utm(double lon, double lat, Elipsoide elip, int husoforced)
          This method makes the conversion between geodesic coordinates to projected coordinates in a UTM zone forced
static double[] newgeo2mercator(double lon, double lat)
          Converts the given coordinates into the Mercator projection (whole world)
static double[] PIGbsl(double lon1_, double lat1_, double lon2_, double lat2_, Elipsoide elip)
           
static double[] PIGbsl(double lon1_, double lat1_, double lon2_, double lat2_, Elipsoide elip, double threshold)
          geodetic Direct Problem.
static double[] transEd50Wgs84(double lon, double lat)
          This method makes the coordinates transformation between the ED50 elipsoide to WGS84.
static double[] transWgs84Ed50(double lon, double lat)
          This method makes the coordinates transformation between the WGS84 elipsoide to ED50.
 double[] utm2geo(double x, double y, double huso, Elipsoide elip)
          This method makes the projected coordinates conversion in UTM to geodetic coordenates in the north hemisfery
static double[] utm2geo(double x, double y, double huso, Elipsoide elip, int hemisfery)
          This method makes the projected coordinates conversion in UTM to geodetic coordenates
static double[] wgs842projection(double lon, double lat, IProjection p)
          Converts the given WGS84 coordinates into the specified projection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEGREES_PER_RADIAN

public static final double DEGREES_PER_RADIAN
See Also:
Constant Field Values
Method Detail

geo2utm

public static double[] geo2utm(double lon,
                               double lat,
                               Elipsoide elip,
                               int husoforced)
This method makes the conversion between geodesic coordinates to projected coordinates in a UTM zone forced

Parameters:
lon - Geodesic longitude in decimals deegrees of the point
lat - Geodesic latitude in decimals deegrees of the point
husoforced - UTM Zone forced
Returns:
Array with two elements. X (UTM), Y (UTM)

geo2utm

public static double[] geo2utm(double lon,
                               double lat,
                               Elipsoide elip)
This method makes the conversion between geodesic coordinates to projected coordinates in UTM

Parameters:
lon - Geodesic longitude in decimals deegrees of the point
lat - Geodesic latitude in decimals deegrees of the point
Returns:
Array with three elements. X (UTM), Y (UTM) and zone(UTM)

utm2geo

public double[] utm2geo(double x,
                        double y,
                        double huso,
                        Elipsoide elip)
This method makes the projected coordinates conversion in UTM to geodetic coordenates in the north hemisfery

Parameters:
x - (Coordinate X UTM)
y - (Coordinate Y UTM)
huso - (Zone of the UTM projection system)
Returns:
Array with two elements (longitude, latitude)

utm2geo

public static double[] utm2geo(double x,
                               double y,
                               double huso,
                               Elipsoide elip,
                               int hemisfery)
This method makes the projected coordinates conversion in UTM to geodetic coordenates

Parameters:
x - (Coordinate X UTM)
y - (Coordinate Y UTM)
huso - (Zone of the UTM projection sistem)
hemisfery - (North = 1; South = -1)
Returns:
(longitude, latitude)

distanciaProj

public static double distanciaProj(double lon1,
                                   double lat1,
                                   double lon2,
                                   double lat2,
                                   Elipsoide elip)
This method calculates the projected distance between two points in geodetic coordinates

Parameters:
lon1 - geodetic logitude in decimal deegrees of the initial point in WGS84
lat1 - geodetic latitude in decimal deegrees of the initial point in WGS84
lon2 - geodetic logitude in decimal deegrees of the final point in WGS84
lat2 - geodetic latitude in decimal deegrees of the final point in WGS84
Returns:
double UTM distance in metres between two projected points

dist2gra

public double dist2gra(double lon,
                       double lat,
                       double dist,
                       Elipsoide elip)
IMPRECISA Este método calcula un segundo punto a partir de un punto inicial y una distancia. This method calculates a second point This method calculates the distance in deegrees

Parameters:
lon - geodetic logitude geodetic en grados decimales del punto origen en WGS84
lat - Latitude geodetic en grados decimales del punto origen en WGS84
dist - Distance in metres
Returns:
Angulo en grados decimales desde el punto origen al punto destino

transEd50Wgs84

public static double[] transEd50Wgs84(double lon,
                                      double lat)
This method makes the coordinates transformation between the ED50 elipsoide to WGS84.

Parameters:
lon - longitude
lat - latitude
Returns:
double[] = {longitude trans, latitude trans}

transWgs84Ed50

public static double[] transWgs84Ed50(double lon,
                                      double lat)
This method makes the coordinates transformation between the WGS84 elipsoide to ED50.

Parameters:
lon - longitude
lat - latitude
Returns:
double[] = {longitude trans, latitude trans}

PIGbsl

public static double[] PIGbsl(double lon1_,
                              double lat1_,
                              double lon2_,
                              double lat2_,
                              Elipsoide elip)
                       throws java.lang.Exception
Throws:
java.lang.Exception

PIGbsl

public static double[] PIGbsl(double lon1_,
                              double lat1_,
                              double lon2_,
                              double lat2_,
                              Elipsoide elip,
                              double threshold)
                       throws java.lang.Exception
geodetic Direct Problem. This method returns the distance between two points on the elipsoide. Calculate the geodetic line between the two points.

Parameters:
lon1_ - longitude of the initial point
lat1_ - latitude of the initial point
lon2_ - longitude of the final point
lat2_ - latitude of the final point
elip - Elipsoide
Returns:
azimut1, azimut2, distance in meters
Throws:
java.lang.Exception

geo2mercator

public static double[] geo2mercator(double lon,
                                    double lat,
                                    Elipsoide elip)
Converts the given coordinates into the mercator projection

Parameters:
lon - longitude
lat - latitude
elip - the ellipsoid
Returns:
the coordinates in the mercator projection

newgeo2mercator

public static double[] newgeo2mercator(double lon,
                                       double lat)
Converts the given coordinates into the Mercator projection (whole world)

Parameters:
lon - longitude
lat - latitude
Returns:
the coordinates in the Mercator projection. The unit is the equatorian degree

wgs842projection

public static double[] wgs842projection(double lon,
                                        double lat,
                                        IProjection p)
Converts the given WGS84 coordinates into the specified projection

Parameters:
lon - longitude
lat - latitude
p - the output projection
Returns:
the coordinates in the specified projection