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
Add Open Location Codes support to search box. #3047
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3047 +/- ##
===========================================
- Coverage 83.14% 60.21% -22.94%
===========================================
Files 246 245 -1
Lines 15430 15426 -4
Branches 2879 2881 +2
===========================================
- Hits 12830 9289 -3541
- Misses 1689 5108 +3419
- Partials 911 1029 +118
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nifty! Didn't realise adding support for plus codes would be so straightforward 🙂
I tried testing this with a random plus code from Google Maps, but it seems to mostly show short plus codes which don't work with this? For Waverley it's XR26+Q2 Edinburgh
. Would be nice if those worked as well. But I don't think that should block this from being merged!
Bit annoying they don't show you the full plus code as well (which for that one is 9C7RXR26+Q2). To make it simpler to share, one can provide a plus code relative to another base and then only give the string for the base rather than its code. Then to reverse you geocode the string and take the nearest "XR26+Q2" to that. So in this case "Edinburgh" is "9C7RXR36+" and so you then get the full code from that. It means if geocoders give different results for the same string, you could conceivably get different results, so they recommend using smaller neighbourhoods that are less likely to be different (but presumably also less likely to be found at all?!). https://github.com/google/open-location-code/wiki/Guidance-for-shortening-codes has a bit more. The library I've added does also handle shortening/expanding, apart from the actual geocoding part. When I have a mo, I'll look at adding that, I guess it'll have to call the external geocoder, take the first result and hope that it's right. |
Actually having written that down, it seemed quite straightforward, so have done that now too, in a new commit :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧭
No description provided.