Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106049

Qt Android's QGeoCoordinate API returns altitude in wrong reference frame

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.8, 6.4.0 Beta3
    • Positioning
    • None
    • Android
    • 8
    • Foundation PM Prioritized

    Description

      Problem

      It was found that the altitude value returned by QGeoCoordinate API is in a 'ellipsoidal height' frame, instead of 'geoid (AMSL : Altitude above Mean Sea Level)' frame, which caused the altitude error of over 53 meters. Tested on 'Galaxy S10, Android version 12'.

      Original reported Issue on open source project: https://github.com/mavlink/qgroundcontrol/issues/10232

      This was confirmed quickly as I was using the Qt for the Ground Control Station for a Drone, and the drone's GPS receiver's data (plot included in the link above) clearly showed that it matched the 'ellipsoidal' height. This is a trustworthy data, as drone's GPS has a very high accuracy.

      Background info

      There are two most commonly used reference frames for GPS altitude: Geoid (Mean Sea Level) and Ellipsoid. You can refer to the definitions in the article below.

      https://en.wikipedia.org/wiki/Geoid

      Diagnosis

      As Qt probably uses Android's API to get the altitude data, it could be that it is using Android's API wrongly.

      https://developer.android.com/reference/android/location/Location#getAltitude()

      Android's specification "The altitude of this location in meters above the WGS84 reference ellipsoid." means it returns 'ellipsoidal' altitude.

      And there has been reports about people running into the same problem of Android's Location API not returning the 'AMSL' altitude. So Qt is probably not the only one struggling with this.

      https://stackoverflow.com/questions/11168306/is-androids-gps-altitude-incorrect-due-to-not-including-geoid-height

      Qt's QGeoCoordinate API statement "This property holds the altitude in meters above sea level." means it return 'geoid' altitude. And as far as I know, Android doesn't support native calculations to return this value.

      https://doc.qt.io/qt-5/qgeocoordinate.html#altitude-prop

      However note that a user also states depending on the device, the Android's Location API returns altitude in different reference frames. So maybe it is not fixable in Qt's side as it is a native Android bug (not confirmed yet).

      Questions

      1. Could it be that Qt uses some wrong Android API to get the altitude for the QGEoCoordinate API? (Blindly using ellipsoidal height as AMSL height)
      2. If so, could the Qt change it's documentation to say that 'ellipsoidal' height is being returned?

      Any other feedbacks on how to tackle this issue / test them would be greatly appreciated as well!

      Attachments

        Activity

          People

            cnn Qt Core & Network
            junwooooo Junwo Hwang
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: