toga icon indicating copy to clipboard operation
toga copied to clipboard

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

Open gy-mate opened this issue 11 months ago • 3 comments

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).

gy-mate avatar Jan 19 '25 00:01 gy-mate

Sure - this seems like a reasonable (and reasonably straightforward) addition. We're going need to modify the LatLng class to fields for accuracy, which must have default values of None (as LatLng is also used by maps) to indicate that accuracy isn't known.

freakboy3742 avatar Jan 19 '25 01:01 freakboy3742

Hi, I want to work on this issue. Can you assign it to me?

dkarvan8 avatar Feb 01 '25 15:02 dkarvan8

We don't use the GitHub assignment feature – posting a comment is enough.

You've posted this comment on 5 issues today, but I recommend you only work on one at a time until you're more familiar with the project.

mhsmith avatar Feb 01 '25 15:02 mhsmith