Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current_location() could also return LatLng's accuracy #3112

Open
gy-mate opened this issue Jan 19, 2025 · 3 comments
Open

current_location() could also return LatLng's accuracy #3112

gy-mate opened this issue Jan 19, 2025 · 3 comments
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start!

Comments

@gy-mate
Copy link

gy-mate commented Jan 19, 2025

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 gy-mate added the enhancement New features, or improvements to existing features. label Jan 19, 2025
@freakboy3742
Copy link
Member

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 freakboy3742 added good first issue Is this your first time contributing? This could be a good place to start! android The issue relates to Android mobile support. iOS The issue relates to Apple iOS mobile support. macOS The issue relates to Apple macOS support. and removed android The issue relates to Android mobile support. iOS The issue relates to Apple iOS mobile support. macOS The issue relates to Apple macOS support. labels Jan 19, 2025
@dkarvan8
Copy link

dkarvan8 commented Feb 1, 2025

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

@mhsmith
Copy link
Member

mhsmith commented Feb 1, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start!
Projects
None yet
Development

No branches or pull requests

4 participants