org.dinopolis.gpstool.gpsinput
Class GPSPosition

java.lang.Object
  extended byorg.dinopolis.gpstool.gpsinput.GPSPosition

public class GPSPosition
extends java.lang.Object

Holds information about a position (latitude/longitude/altitude).

Version:
$Revision: 1.5 $
Author:
Christof Dallermassl

Constructor Summary
GPSPosition()
          Default Constructor
GPSPosition(double latitude, double longitude)
          Constructing a GPSPosition.
GPSPosition(double latitude, double longitude, double altitude)
          Constructing a GPSPosition.
GPSPosition(double latitude, double longitude, double altitude, java.lang.String name)
          Constructing a GPSPosition.
GPSPosition(double latitude_wgs84, java.lang.String north_south, double longitude_wgs84, java.lang.String east_west)
          Constructing a GPSPosition.
GPSPosition(double latitude_wgs84, java.lang.String north_south, double longitude_wgs84, java.lang.String east_west, double altitude)
          Constructing a GPSPosition.
GPSPosition(double latitude_wgs84, java.lang.String north_south, double longitude_wgs84, java.lang.String east_west, double altitude, java.lang.String name)
          Constructing a GPSPosition.
GPSPosition(double latitude_wgs84, java.lang.String north_south, double longitude_wgs84, java.lang.String east_west, java.lang.String name)
          Constructing a GPSPosition.
GPSPosition(GPSPosition gpsposition)
          Copy Constructor
 
Method Summary
 boolean equals(java.lang.Object pos)
           
 double getAltitude()
          Returns the altitude of the gps position or Double.NaN if the altitude is unknown (not set).
 double getLatitude()
          Returns the latitude of the gps position.
 double getLongitude()
          Returns the longitude of the gps position.
 void setAltitude(double altitude)
          Sets the altitude of the gps position.
 void setLatitude(double latitude)
          Sets the latitude of the gps position.
 void setLongitude(double longitude)
          Sets the longitude of the gps position.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GPSPosition

public GPSPosition()
Default Constructor


GPSPosition

public GPSPosition(double latitude_wgs84,
                   java.lang.String north_south,
                   double longitude_wgs84,
                   java.lang.String east_west)
            throws java.lang.IllegalArgumentException
Constructing a GPSPosition.

Parameters:
latitude_wgs84 - the latitude in wgs84 format (degree).
north_south -
longitude_wgs84 - the longitude in wgs84 format (degree).
east_west -
Throws:
java.lang.IllegalArgumentException - if north_south or east_west are neither "N","S" resp. "E", "W" or the latitude/longitude are incorrect.

GPSPosition

public GPSPosition(double latitude_wgs84,
                   java.lang.String north_south,
                   double longitude_wgs84,
                   java.lang.String east_west,
                   double altitude)
            throws java.lang.IllegalArgumentException
Constructing a GPSPosition.

Parameters:
latitude_wgs84 - the latitude in wgs84 format (degree).
north_south -
longitude_wgs84 - the longitude in wgs84 format (degree).
east_west -
altitude -
Throws:
java.lang.IllegalArgumentException - if north_south or east_west are neither "N","S" resp. "E", "W" or the latitude/longitude are incorrect.

GPSPosition

public GPSPosition(double latitude_wgs84,
                   java.lang.String north_south,
                   double longitude_wgs84,
                   java.lang.String east_west,
                   java.lang.String name)
            throws java.lang.IllegalArgumentException
Constructing a GPSPosition.

Parameters:
latitude_wgs84 - the latitude in wgs84 format (degree).
north_south -
longitude_wgs84 - the longitude in wgs84 format (degree).
east_west -
name - the name of the position
Throws:
java.lang.IllegalArgumentException - if north_south or east_west are neither "N","S" resp. "E", "W" or the latitude/longitude are incorrect.

GPSPosition

public GPSPosition(double latitude_wgs84,
                   java.lang.String north_south,
                   double longitude_wgs84,
                   java.lang.String east_west,
                   double altitude,
                   java.lang.String name)
            throws java.lang.IllegalArgumentException
Constructing a GPSPosition.

Parameters:
latitude_wgs84 - the latitude in wgs84 format (degree).
north_south -
longitude_wgs84 - the longitude in wgs84 format (degree).
east_west -
altitude -
name - the name of the position
Throws:
java.lang.IllegalArgumentException - if north_south or east_west are neither "N","S" resp. "E", "W" or the latitude/longitude are incorrect.

GPSPosition

public GPSPosition(double latitude,
                   double longitude)
Constructing a GPSPosition.

Parameters:
latitude - the latitude (pos for north, negativ for south)
longitude - the longitude (pos for east, negativ for west).

GPSPosition

public GPSPosition(double latitude,
                   double longitude,
                   double altitude)
Constructing a GPSPosition.

Parameters:
latitude - the latitude (pos for north, negativ for south)
longitude - the longitude (pos for east, negativ for west).
altitude -

GPSPosition

public GPSPosition(double latitude,
                   double longitude,
                   double altitude,
                   java.lang.String name)
Constructing a GPSPosition.

Parameters:
latitude - the latitude (pos for north, negativ for south)
longitude - the longitude (pos for east, negativ for west).
altitude -

GPSPosition

public GPSPosition(GPSPosition gpsposition)
Copy Constructor

Parameters:
gpsposition -
Method Detail

getLongitude

public double getLongitude()
Returns the longitude of the gps position. Returns positive values for longitudes in the eastern hemisphere, negative values for the western hemisphere.

Returns:
the longitude of the gps position.

setLongitude

public void setLongitude(double longitude)
Sets the longitude of the gps position. Positive values for longitudes are in the eastern hemisphere, negative values in the western hemisphere.

Parameters:
longitude - the longitude of the gps position.

getLatitude

public double getLatitude()
Returns the latitude of the gps position. Returns positive values for latitudes in the northern hemisphere, negative values for the southern hemisphere.

Returns:
the latitude of the gps position.

setLatitude

public void setLatitude(double latitude)
Sets the latitude of the gps position. Positive values for latitudes are in the eastern hemisphere, negative values in the western hemisphere.

Parameters:
latitude - the latitude of the gps position.

getAltitude

public double getAltitude()
Returns the altitude of the gps position or Double.NaN if the altitude is unknown (not set).

Returns:
the altitude of the gps position or Double.NaN if the altitude is unknown (not set).

setAltitude

public void setAltitude(double altitude)
Sets the altitude of the gps position.

Parameters:
altitude - the altitude of the gps position.

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object pos)