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

Improve location add function #145

Open
Tyler-2 opened this issue Jan 11, 2021 · 9 comments
Open

Improve location add function #145

Tyler-2 opened this issue Jan 11, 2021 · 9 comments

Comments

@Tyler-2
Copy link

Tyler-2 commented Jan 11, 2021

In the U.S.A, most people, when prompted to enter their location, will provide their ZIP / postal code. Weather doesn't appear to support that, as entering a zip code doesn't produce anything in the dropdowns. As a fallback, I decided to enter my city... But the dropdown list provides 5 or 6 matches for my city, none specific enough. For instance: "Buena Vista, US", with lat/longs for each, because there are many states in the US with a city called Buena Vista. Most folks don't know their lat/long. It would be more typical here to say "Buena Vista, TX, US".

It would be best to get zip codes working.
But at a minimum, the state that a city is in should be shown.

@sleep-yearning
Copy link
Member

Thanks for your comment @Tyler-2, unfortunately we had to ditch the ZIP codes, as the newer OWM database doesn't contain them anymore.
The map view should help with choosing the specific entry, not?
It would be possible to add a town to ZIP code library, is the map view not enough though?

@Tyler-2
Copy link
Author

Tyler-2 commented Jan 14, 2021

I didn't find the map view particularly useful. Search, for instance, for Fairfax. It seems like I'd have to click each Fairfax, see where it is on the small map, and then go back up, backspace away the autocomplete until the list comes up again, try again, repeat...

It sounds like OWM doesn't even support States...

Search engine is very flexible. How it works:

To make it more precise put the city's name, comma, 2-letter country code (ISO3166). You will get all proper cities in chosen country.
The order is important - the first is city name then comma then country. Example - London, GB or New York, US.

No mention of states. That's.... really rough for US users. We have a lot of city names that are common in a lot of states.

The only thing I can think of if OWM can't return this data is passing the geo coords for U.S. cities into an OSM function that returns the state.

@sleep-yearning
Copy link
Member

Would a display of multiple results on the map solve this?
So you could view all of the remaining cities in the list on the map at the same time.

@Tyler-2
Copy link
Author

Tyler-2 commented Jan 15, 2021

Yeah, that would help.

@Kamuno Kamuno changed the title Adding U.S. cities is difficult Improve location add function Feb 26, 2021
@woheller69
Copy link
Contributor

what about using a free geocoder API like this https://photon.komoot.io/ ?

@woheller69
Copy link
Contributor

I played around a little with this API, maybe I am going to use it in future in RadarWeather even though it will be quite some work to adapt the app to completely work without a city ID...

If you want to play with the search tool you can try this little app: https://github.com/woheller69/AutoSuggestTextViewAPICall

@woheller69
Copy link
Contributor

I implemented it in V3.0 of RadarWeather. Works great. Once activated in settings you can find any place in the world that is in OpenStreetMap - also via ZIP code

@sleep-yearning
Copy link
Member

Another approach could (optionally) filter the results for geographic closeness to current location (if the location feature would get implemented).

@woheller69
Copy link
Contributor

The photon API would also allow such filtering but I don't think it is necessary. It works very fast with few clicks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants