Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.12.8, 6.4.0 Beta3
-
None
-
-
8
-
0f3efd9b2 (dev)
-
Foundation Sprint 100, Foundation Sprint 101
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.
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
- 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)
- 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
For Gerrit Dashboard: QTBUG-106049 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
535892,8 | Android: allow to convert altitude to MSL on Android 14 and later | dev | qt/qtpositioning | Status: MERGED | +2 | 0 |