dglent / meteo-qt

System tray application for weather status information
GNU General Public License v3.0
82 stars 21 forks source link

Show State in US City Names #142

Open amcginni opened 5 months ago

amcginni commented 5 months ago

It is common for city names in the US to be re-used across multiple states. Currently, meto-qt does not show the state name or abbreviation of US cities. This has users needing to pick the correct lat/lon values from a list of cities of the same name. For example, apparently there are 5 cities named Syracuse in the United States: image

Syracuse, New York is what I am after in this example, but a search for "Syracuse, NY" returns no results, and "Syracuse, New York" simply returns the top five cities in the world with names like Syracuse, including two in Italy.

What is proposed here is to display the two-digit state abbreviation in the name of any US city, so the above example of the Find City dialog might look something like this: screen

I see that the Open Weather Map website also shows only the city name and country, so it might not be as easy as simply displaying displaying some value we're already getting back. I see too that the Open Weather Map API supports queries by lat/lon. Maybe this could be accomplished by querying some third-party API like GeoNames for the place names and feeding the lat/lon into Open Weather Map?

dglent commented 5 months ago

I agree it is very usefull However i don't get the State with the actual call. It needs a second call here : https://openweathermap.org/api/geocoding-api to get the State by city name and coordinates.

The actual call provides the city id which is not provided from the geocoding api.

Let me see how to combine both. Thanks for reporting this