thecodecrate / city-state

Simple ruby gem to create form lists with cities and states
MIT License
306 stars 135 forks source link

Singapore cities are missing but present in MaxMind DB #39

Closed erbunao closed 4 years ago

erbunao commented 4 years ago

The CSV pulled from MaxMind shows that several cities are available from Singapore. However those cities do not have a corresponding state which ended up excluded from the search list.

I was wondering if there are existing workarounds with this scenario. Is there a more future-proof way of dealing with a city without a state?

loureirorg commented 4 years ago

With version 0.1.0 (released yesterday), you can now add missing states by editing db/states-lookup.yml.

In the following example all cities with no corresponding state will be assigned to a new state named "Missing State":

SG:
  "": "Missing State"

You can also rename or add missing cities by editing db/cities-lookup.yml.

I am not sure this would fix the issue you are experiencing though, because it is a flaw on MaxMind database, but I am working on a new version of this gem that uses alternative sources. I am thinking to use OpenStreetMaps database but there are some technical difficulties in doing so - the OSM database size is about 40GB, so I am thinking to use GitHub Actions to process this database from time to time. Anyway, improvements are coming :)

PS: Sorry for the delayed reply.

erbunao commented 4 years ago

That's no problem @loureirorg! Thanks for the update, I think this solves the problem at least for missing states.