[Feature Request]: Reading altitude from NMEA messages not only from the GPS system #1473
Closed
2 of 7 tasks
Labels
P2
Important issues not at the top of the work list.
platform: android
Issue is related to the Android platform.
refactor
Issues marked with refactor should be considered when refactoring the plugin.
Is there already an issue requesting this feature?
Please select affected platform(s)
Use case
In Android we can use useMSLAltitude flag to read altitude from NMEA messages:
https://pub.dev/documentation/geolocator_android/latest/geolocator_android/AndroidSettings/useMSLAltitude.html
The problem is that Geolocator only reads the altitude from the GPS system. In my case, my two Android devices receive messages with ID $GNGGA (instead of $GPGGA), example:
$GNGGA,113733.000,0000.4351,N,00000.7576,E,1,20,0.60,277.7,M,42.0,M,,*7F
and Geolocator does not read altitude from NMEA
https://www.raveon.com/ApplicationNotes/AN246(NMEA_GNSS).pdf
https://openrtk.readthedocs.io/en/latest/communication_port/nmea.html
Here is an example of other Talker ID prefixes (but for a GNS message):
GA: Galileo
GB: BeiDou
GP: GPS
GL: GLONASS. When more than one constellation is used.
GN: Combined GNSS position, for example, GPS and GLONASS.
GQ: QZSS
https://receiverhelp.trimble.com/alloy-gnss/en-us/NMEA-0183messages_GNS.html
Proposal
To solve this problem, just modify the code in two places:
flutter-geolocator/geolocator_android/android/src/main/java/com/baseflow/geolocator/location/NmeaClient.java
Line 47 in eaa173f
if (message.trim().matches("^\\$..GGA.*$")) {
flutter-geolocator/geolocator_android/android/src/main/java/com/baseflow/geolocator/location/NmeaClient.java
Line 120 in eaa173f
if (type.matches("^\\$..GGA$") && tokens.length > 9) {
Specific requirements or considerations
No response
Additional information or context
No response
The text was updated successfully, but these errors were encountered: