Understanding the location fix

When the positionUpdated() signal is emitted, location fix information is returned to your app, including a global position, direction, and velocity at a particular point in time.

Each location fix is represented by an instance of the QGeoPositionInfo class. The QGeoPositionInfo class contains a QGeoCoordinate that includes the latitude, longitude, and altitude of the location fix.

The QGeoPositionInfo class also contains an QGeoPositionInfo::attribute enumeration that contains the speed, direction, and accuracy of the location fix.

Screen showing the location information from the Location diagnostics sample app.

The following information can be extracted from the QGeoPositionInfo:

  • QGeoCoordinate

    The geographical position of the device on the surface of the Earth. This information is provided as latitude, longitude, and optionally, altitude.

  • Direction

    The heading or bearing to true north from the direction of travel, in degrees.

  • GroundSpeed

    The speed of a device that's moving horizontally, in meters per second.

  • VerticalSpeed

    The speed of a device that's moving vertically, in meters per second.

  • MagneticVariation

    The angle between the horizontal component of the magnetic field and true north, in degrees. If this value is positive, the device is pointed clockwise away from true north. If this value is negative, the device is pointing counter-clockwise away from true north.

  • HorizontalAccuracy

    The accuracy of the provided latitude and longitude values, in meters.

  • Vertical Accuracy

    The accuracy of the provided altitude value, in meters.

  • Timestamp

    The time that the location fix was found, in Coordinated Universal Time (UTC) format.

Not all pieces of information are always available. Depending on the provider, you might not get the ground speed or other properties.

The attributes of the QGeoPositionInfo class will satisfy most application needs. You can also retrieve additional properties, including the exact method that was used to find the location fix. This is useful if you specified the default positioning method that uses all positioning methods to get a location in your app and you need to know which method was actually used. Other properties that you can retrieve are:

  • gpsToW: GPS time of week
  • gpsWeek: GPS week
  • hdop: The horizontal dilution of precision (for computing the horizontal accuracy)
  • method: The exact method that was used to compute the location fix
  • pdop: The positional (3-D) dilution of precision
  • ttff: The time taken to find the first fix. The first fix always takes the longest when using GPS
  • vdop: The vertical dilution of precision

For more information about parsing the QGeoPositionInfo, see the LocationDiagnostics sample app on the Sample apps page.

Last modified: 2013-12-21

comments powered by Disqus