Class GpsFix

java.lang.Object
org.ka2ddo.gps.GpsFix
All Implemented Interfaces:
Serializable, Cloneable

public class GpsFix extends Object implements Serializable, Cloneable
This class is a data structure containing one GPS location fix. Position, velocity, quality, and time of fix are all reported.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    GPS altitude in meters above mean sea level (WGS84 model).
    float
    Bearing of travel, in degrees relative to True North.
    int
    The ID number of the differential GPS surface station that transmitted the last-received correction data.
    float
    Horizontal dilution of precision value.
    short
    Indicate the type of GPS sentence that provided the position and course information.
    double
    GPS latitude in degrees North.
    long
    Error in milliseconds between computer system clock and GPS time.
    double
    GPS longitude in degrees East.
    static final float
    Constant for converting nautical miles to kilometers.
    static final float
    Constant for converting nautical miles to statute miles.
    int
    Number of satellites used for the last fix, or -1 for unknown.
    Quality of the last GPS fix.
    float
    Seconds since the last differential GPS correction data was received, or -1 if unknown.
    static final short
    A $GPGGA sentence provided the position.
    static final short
    A $GPGLL sentence provided the position.
    static final short
    A $GPRMC sentence provided the position.
    static final short
    We don't know what kind of sentence provided the position information (or it's something not included in the compressed position definition in the APRS protocol specification).
    The name of the remote GPS providing this fix (null if for the station's own local GPS).
    float
    Speed of motion in knots (nautical miles per hour), or -1 if unknown.
    long
    Timestamp of last GPS sentence in Java milliseconds since 1 Jan 1970 UTC.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Overwrite another GpsFix object with this GpsFix's values.
    dup()
    Make a deep copy of this GpsFix object.
    boolean
    Test if this GpsFix is close enough to another fix to be considered the same position.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • NMI_SMI

      public static final float NMI_SMI
      Constant for converting nautical miles to statute miles.
      See Also:
    • NMI_KM

      public static final float NMI_KM
      Constant for converting nautical miles to kilometers.
      See Also:
    • timestamp

      public long timestamp
      Timestamp of last GPS sentence in Java milliseconds since 1 Jan 1970 UTC.
    • latitude

      public double latitude
      GPS latitude in degrees North.
    • longitude

      public double longitude
      GPS longitude in degrees East.
    • quality

      public GpsFixQuality quality
      Quality of the last GPS fix.
    • numSatellites

      public int numSatellites
      Number of satellites used for the last fix, or -1 for unknown.
    • hdop

      public float hdop
      Horizontal dilution of precision value.
    • amslM

      public float amslM
      GPS altitude in meters above mean sea level (WGS84 model).
    • secSinceLastDGps

      public float secSinceLastDGps
      Seconds since the last differential GPS correction data was received, or -1 if unknown.
    • dgpsStationId

      public int dgpsStationId
      The ID number of the differential GPS surface station that transmitted the last-received correction data.
    • speed

      public float speed
      Speed of motion in knots (nautical miles per hour), or -1 if unknown.
    • bearing

      public float bearing
      Bearing of travel, in degrees relative to True North.
    • localToGpsClockDiff

      public long localToGpsClockDiff
      Error in milliseconds between computer system clock and GPS time.
    • source

      public String source
      The name of the remote GPS providing this fix (null if for the station's own local GPS).
    • SENTENCETYPE_UNKNOWN

      public static final short SENTENCETYPE_UNKNOWN
      We don't know what kind of sentence provided the position information (or it's something not included in the compressed position definition in the APRS protocol specification).
      See Also:
    • SENTENCETYPE_GLL

      public static final short SENTENCETYPE_GLL
      A $GPGLL sentence provided the position.
      See Also:
    • SENTENCETYPE_GGA

      public static final short SENTENCETYPE_GGA
      A $GPGGA sentence provided the position.
      See Also:
    • SENTENCETYPE_RMC

      public static final short SENTENCETYPE_RMC
      A $GPRMC sentence provided the position.
      See Also:
    • lastPositionSentenceType

      public short lastPositionSentenceType
      Indicate the type of GPS sentence that provided the position and course information.
      See Also:
  • Constructor Details

    • GpsFix

      public GpsFix()
  • Method Details

    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • dup

      public GpsFix dup()
      Make a deep copy of this GpsFix object.
      Returns:
      copy of this object
      See Also:
    • copyInto

      public void copyInto(GpsFix dest)
      Overwrite another GpsFix object with this GpsFix's values.
      Parameters:
      dest - GpsFix to copy the values into
    • sameValue

      public boolean sameValue(GpsFix other)
      Test if this GpsFix is close enough to another fix to be considered the same position.
      Parameters:
      other - another GpsFix object to compare
      Returns:
      boolean true if close enough (.0002 degrees of latitude and longitude, 0.1 knots of speed, and 1 degree of bearing)