flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

MSL Altitude on Android

Open Wackymax opened this issue 3 years ago • 6 comments

:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Feature

:arrow_heading_down: What is the current behaviour?

Currently android reports location altitude as the value received from the GPS directly.

:new: What is the new behaviour (if this is a feature change)?

There are some use cases where MSL altitude is desired instead. NMEA messages can used in these scenarios to get the MSL altitude for the location instead of the normal geoid altitude. This feature adds a new Android setting requesting the platform to report altitude as MSL instead which will then register and NMEA client on the Android side if available and use the NMEA messages instead as the altitude values for position updates.

:boom: Does this PR introduce a breaking change?

No, the change is backwards compatible with existing clients.

:bug: Recommendations for testing

Toggle the Android setting to use MSL or not to use MSL in the example app and observe the difference in altitude being reported

:memo: Links to relevant issues/docs

https://github.com/Baseflow/flutter-geolocator/issues/987

:thinking: Checklist before submitting

  • [x] I made sure all projects build.
  • [x] I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • [x] I updated CHANGELOG.md to add a description of the change.
  • [x] I followed the style guide lines (code style guide).
  • [x] I updated the relevant documentation.
  • [x] I rebased onto current master.

Wackymax avatar May 10 '22 17:05 Wackymax

Codecov Report

Merging #1057 (3dc507e) into main (8aada97) will increase coverage by 17.10%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main    #1057       +/-   ##
===========================================
+ Coverage   81.19%   98.30%   +17.10%     
===========================================
  Files           3        3               
  Lines         117      118        +1     
===========================================
+ Hits           95      116       +21     
+ Misses         22        2       -20     
Impacted Files Coverage Δ
...ocator_android/lib/src/types/android_settings.dart 100.00% <100.00%> (+100.00%) :arrow_up:
...tor_android/lib/src/types/foreground_settings.dart 100.00% <0.00%> (+92.30%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8aada97...3dc507e. Read the comment docs.

codecov[bot] avatar May 10 '22 17:05 codecov[bot]

@mvanbeusekom I know there are a few open PR's for NMEA but I figured I'd make this one to get MSL reporting in without changing any platform interfaces. This also allows Geolocator to mimic the Location package in behaviour which might be beneficial considering many peeps are migrating from that due to it's lack of support.

Wackymax avatar May 10 '22 17:05 Wackymax

@mvanbeusekom did you get a change to look at the PR and the proposed change yet?

Wackymax avatar Jun 17 '22 09:06 Wackymax

@mvanbeusekom anything else that needs to be done?

Wackymax avatar Aug 01 '22 15:08 Wackymax

Hi @Wackymax, I am on a two week holiday now but will have a look at it when I get back.

mvanbeusekom avatar Aug 01 '22 15:08 mvanbeusekom

Oh nice! Enjoy the holiday 😃

On 01 Aug 2022, at 17:47, Maurits van Beusekom @.***> wrote:

 Hi @Wackymax, I am on a two week holiday now but will have a look at it when I get back.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

Wackymax avatar Aug 01 '22 16:08 Wackymax

Hi @Wackymax,

I have tried this feature on the new Geolocator release (9.0.2) on Android 10 (physical device). I use it like this: Geolocator.getPositionStream(locationSettings: new AndroidSettings(accuracy: LocationAccuracy.best, distanceFilter: 2, useMSLAltitude: true)) It doesn't matter if I set useMSLAltitude to true or false. Altitude in both cases are the same, too high about 40 meters at my locaction.

Please also check Geolocator.getCurrentPosition(). There is an AndroidSettings object without flag useMSLAltitude. I don't know if it also matters. Thank you.

memarv avatar Sep 26 '22 15:09 memarv