sanderbaas / WeatherWidget

Add widget to home screen with 4 to 6 day weather forecast in your location
MIT License
22 stars 7 forks source link

Locations (weather stations) not descriptive enough #25

Closed pietervw closed 4 years ago

pietervw commented 4 years ago

Hi guys,

When adding a widget and selecting the location, the filtered results aren't detailed enough. For instance, if a country has more than one location by the same name there isn't a way to tell them apart.

For example, search for "Moosburg". Results are: "Moosburg, AT" "Moosburg, AT" "Moosburg, DE" "Moosburg, DE" "Moosburg, DE"

This prompted me to look at the code and to see if there is another property that can be added in the results list to differentiate between states / provinces, but I see that in the cities.db database there aren't any fields containing such data.

I'd be happy to look at this but the Cities database would need to be updated to include an abbreviation for province or state.

It might also be that some locations are duplicated in the Cities database. Although in the case of the town where I live, the results are definitely referencing different towns/councils when I look at the lat/lon fields in the DB.

Any ideas?

Thanks

sanderbaas commented 4 years ago

I understand your concerns. I will take a look at it

sanderbaas commented 4 years ago

Unfortunately the list of cities provided by OpenWeatherMap only contains the name of the city, the country and the coordinates. So to solve this problem we'd have to use another source to add region information based on the coordinates I think.

This is an excerpt of the cities list from OpenWeatherMap

[ { "id": 707860, "name": "Hurzuf", "country": "UA", "coord": { "lon": 34.283333, "lat": 44.549999 } },

pietervw commented 4 years ago

Looking at what we have, we can use the coordinates to display how far the weather station is from the user. Example: "Moosburg, DE (2km)" "Moosburg, DE (349 km)" "Moosburg, DE (1,200km)"

That would require the app to request location permission which might be privacy concern for some. I'd like to implement a feature like this but I don't want to discourage users who are serious about using FOSS software due to privacy concerns.

sanderbaas commented 4 years ago

@pietervw as long sharing the location is optional (we should ask for this on run time) and the location does not leave the device, I don't see why this would discourage users.

sanderbaas commented 4 years ago

By the way: OpenWeatherMap solves this problem by showing the coordinates and linking them to a map with the location.