beeware/toga

`current_location()` could also return `LatLng`'s accuracy

開放

#3,112 建立於 2025年1月19日

 (6 則留言) (0 個反應) (0 位負責人)Python (624 個分叉)batch import
enhancementgood first issue

倉庫指標

星標
 (3,615 顆星)
PR 合併指標
 (平均合併 5天) (30 天內合併 64 個 PR)

描述

What is the problem or limitation you are having?

I'd like to know how accurate the GPS coordinates received from the OS are. They can often be really far from reality, and it would be helpful to know if this is the case.

Describe the solution you'd like

toga.hardware.location.Location.current_location() could also return the horizontal and vertical accuracy of the recorded LatLng.

Describe alternatives you've considered

Writing a method myself that estimates the location accuracy by checking if the coordinates are stable (near each other) or "jumping around". But this would be an approximation of the approximation.

Additional context

Maybe it can be done like this?

Apple

The macOS and iOS versions of toga_location() should also return horizontalAccuracy and verticalAccuracy.

Android

toga_location() should also return the return values of getAccuracy() (only if hasAccuracy() is true) and getVerticalAccuracyMeters() (only if hasVerticalAccuracy() is true).

Linux (GTK)

toga_location() should also return the return value of the accuracy property, which probably refers to the horizontal accuracy. Vertical accuracy is unavailable on this platform.

貢獻者指南