Open nikil opened 8 years ago
Yep, it's definitely a feature I'm looking into. This was a regression from the worldweatheronline API, which allowed locations specified as city names or even postal codes. A few other possible backends also only support lat,lon-pairs, so it will definitely be added.
I don't like the solution you found, since it has to do another RTT of network traffic before requesting the weather data. A local database would be more fitting.
How big would such a database be, though? I could ask wego Plavy
before, which refers to a village in Czech Republic, and get a sensible reply. Maybe it'd be better to use geocoder, but cache resolved locations in .wegorc.
Since forecast.io only supports latitude/longitude style locations, it would be nice to have an interface where we could specify a normal location (e.g., "Los Angeles") and have the backend convert automatically to lat/long. When displaying the weather, you could also convert from the lat/long used in the forecast.io lookup back to a canonical location string.
It appears that there's a Go library for just such this purpose: https://github.com/jasonwinn/geocoder
Any chance this could be integrated into wego?