jwo.landserf.process.gps
Class GPSPosition

java.lang.Object
  extended byjwo.landserf.process.gps.GPSPosition
All Implemented Interfaces:
Position

public class GPSPosition
extends Object
implements Position

Used to represent any point location transmitted to or from GPS.

Version:
2.2, 23rd June, 2004.
Author:
Jo Wood, based on the design by Henrik Sorensen (haas@itu.dk).

Constructor Summary
GPSPosition()
          Creates a new position.
GPSPosition(double lat, double lng, float alt)
          Initializes the position with a given latitude, longitude and altitude.
GPSPosition(GPSPosition position)
          Initializes the position object with a given position.
 
Method Summary
 float getAltitude()
          Reports the altitude of this position.
 AngleRadians getLatitude()
          Reports the latitude of this position in radians.
 AngleRadians getLongitude()
          Reports the longitude of this position in radians.
 void setAltitude(float alt)
          Sets the altitude of this position.
 void setLatitude(AngleRadians lat)
          Sets the latitude of this position.
 void setLongitude(AngleRadians lng)
          Sets the longitude of this position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GPSPosition

public GPSPosition()
Creates a new position. Initializes the latitude, longitude and altitude to 0.


GPSPosition

public GPSPosition(double lat,
                   double lng,
                   float alt)
Initializes the position with a given latitude, longitude and altitude.

Parameters:
lat - Latitude of position.
lng - Longitude of position.
alt - Altitude of this postion (can be 0 if not used).

GPSPosition

public GPSPosition(GPSPosition position)
Initializes the position object with a given position.

Parameters:
position - Position with which to initialise.
Method Detail

setLatitude

public void setLatitude(AngleRadians lat)
Sets the latitude of this position.

Parameters:
lat - New latitude for this position.

setLongitude

public void setLongitude(AngleRadians lng)
Sets the longitude of this position.

Parameters:
lng - New longitude for this position in radians.

setAltitude

public void setAltitude(float alt)
Sets the altitude of this position.

Parameters:
alt - New altitude of this position.

getLatitude

public AngleRadians getLatitude()
Reports the latitude of this position in radians.

Specified by:
getLatitude in interface Position
Returns:
Latitude of this position in radians.

getLongitude

public AngleRadians getLongitude()
Reports the longitude of this position in radians.

Specified by:
getLongitude in interface Position
Returns:
Longitude of this position.

getAltitude

public float getAltitude()
Reports the altitude of this position.

Specified by:
getAltitude in interface Position
Returns:
Altitude of this position.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005