com.partnersoft.v3x.io.gps
Class GPSPosition

java.lang.Object
  extended by com.partnersoft.v3x.io.gps.GPSPosition
All Implemented Interfaces:
java.io.Serializable

public class GPSPosition
extends java.lang.Object
implements java.io.Serializable

This is the last piece of the 3x GPS code. It's here because jobs refer to GPSPosition by class name. A GPS position reading.

See Also:
Serialized Form

Constructor Summary
GPSPosition()
           
GPSPosition(double longitude, double latitude)
           
 
Method Summary
 GPSPosition copy()
           
 double getBearing()
          Gets the value of bearing
 int[][] getIntegerCoords()
          Returns two int arrays; each has deg, minutes, seconds, and thousandths of a second (mils).
 double getLatitude()
          Gets the value of latitude
 double getLatitudeDegrees()
           
 double getLatitudeMinutes()
           
 double getLatitudeSeconds()
           
 double getLongitude()
          Gets the value of longitude
 double getLongitudeDegrees()
           
 double getLongitudeMinutes()
           
 double getLongitudeSeconds()
           
 double getPdop()
          Gets the value of pdop
 java.lang.String getPositionString()
           
 int getSatellites()
          Gets the value of satellites
 PartnerDateTime getTime()
          Gets the value of time
 double getVelocity()
          Gets the value of velocity
 boolean isValidReading()
          This seems like the best place to handle points at 0, 0.
 void setBearing(double argBearing)
          Sets the value of bearing
 void setLatitude(double argLatitude)
          Sets the value of latitude
 void setLongitude(double argLongitude)
          Sets the value of longitude
 void setPdop(double argPdop)
          Sets the value of pdop
 void setSatellites(int argSatellites)
          Sets the value of satellites
 void setTime(PartnerDateTime argTime)
          Sets the value of time
 void setVelocity(double argVelocity)
          Sets the value of velocity
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GPSPosition

public GPSPosition()

GPSPosition

public GPSPosition(double longitude,
                   double latitude)
Method Detail

getIntegerCoords

public int[][] getIntegerCoords()
Returns two int arrays; each has deg, minutes, seconds, and thousandths of a second (mils). result[0] is longitude; result[1] is latitude.


getPositionString

public java.lang.String getPositionString()

getBearing

public double getBearing()
Gets the value of bearing

Returns:
the value of bearing

setBearing

public void setBearing(double argBearing)
Sets the value of bearing

Parameters:
argBearing - Value to assign to this.bearing

getLongitude

public double getLongitude()
Gets the value of longitude

Returns:
the value of longitude

setLongitude

public void setLongitude(double argLongitude)
Sets the value of longitude

Parameters:
argLongitude - Value to assign to this.longitude

getLatitude

public double getLatitude()
Gets the value of latitude

Returns:
the value of latitude

setLatitude

public void setLatitude(double argLatitude)
Sets the value of latitude

Parameters:
argLatitude - Value to assign to this.latitude

getTime

public PartnerDateTime getTime()
Gets the value of time

Returns:
the value of time

setTime

public void setTime(PartnerDateTime argTime)
Sets the value of time

Parameters:
argTime - Value to assign to this.time

getPdop

public double getPdop()
Gets the value of pdop

Returns:
the value of pdop

setPdop

public void setPdop(double argPdop)
Sets the value of pdop

Parameters:
argPdop - Value to assign to this.pdop

getSatellites

public int getSatellites()
Gets the value of satellites

Returns:
the value of satellites

setSatellites

public void setSatellites(int argSatellites)
Sets the value of satellites

Parameters:
argSatellites - Value to assign to this.satellites

getVelocity

public double getVelocity()
Gets the value of velocity

Returns:
the value of velocity

setVelocity

public void setVelocity(double argVelocity)
Sets the value of velocity

Parameters:
argVelocity - Value to assign to this.velocity

getLongitudeDegrees

public double getLongitudeDegrees()

getLongitudeMinutes

public double getLongitudeMinutes()

getLongitudeSeconds

public double getLongitudeSeconds()

getLatitudeDegrees

public double getLatitudeDegrees()

getLatitudeMinutes

public double getLatitudeMinutes()

getLatitudeSeconds

public double getLatitudeSeconds()

isValidReading

public boolean isValidReading()
This seems like the best place to handle points at 0, 0. For some reason, all GPS receivers like to return coordinates at latitude 0, longitude 0 for some error conditions. Rather than filtering it at the GPS daemon, which innocently thinks that the zero zero points are legitimate readings, we filter it inside the GPSPosition. This method returns true if the reading is stupid. At the time of this writing, we define that as a latitude or longitude of zero, which corresponds to a point in the Pacific Ocean a few hundred miles off the coast of Africa.

Returns:

copy

public GPSPosition copy()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object