melton-foundation / Melton-App-Client-Flutter

Production quality Flutter code. Simple online store, blogs written in markdown, custom Google map, search with filters
https://meltonapp.com
MIT License
6 stars 1 forks source link

Add states for US cities #37

Open pranavsb opened 3 years ago

pranavsb commented 3 years ago

The options in world_cities.dart are taken from simplemaps (free, smaller version of the database). Only the cities with more than 100,000 population have been chosen. For cities with a common name (in ASCII) and a common country, the city with higher population is chosen.

This can lead to some confusion, esp. in the US, which has multiple states with the same city name.

The workaround is to choose your city in the dropdown (say Gainesville, United States) and check the map to see if we're putting you in Gainesville, FL or Gainesville, GA (spoiler alert: it's Georgia).

Then you'd have to fall back to searching for the nearest city which is included in the list, which is made hard by the fact that many US cities have been included, with no state, so you can't search by your state.

pranavsb commented 3 years ago

To get started on this, just look at scripts directory and download the simplemaps csv from their website. A small modification in the script (to account for country == "United States" and append 2 letter state code to the city, country string should solve our problem.

For a complete fix, we would also have to go back to the dashboard to fix some cases where such ambiguous cities have been chosen.