devdata.io icon indicating copy to clipboard operation
devdata.io copied to clipboard

US Cities -City : State - Key Value Pair

Open mrwigster opened this issue 10 years ago • 1 comments

US Cities with corresponding abbreviated state code.

mrwigster avatar Aug 07 '15 13:08 mrwigster

This dataset will not work as-is - There are many cities with the same names in multiple states, and when the city name is the key, the last one will overwrite all the others. For example, I live in Shawnee, OK but there is also a Shawnee, KS. The current JSON will not result in both of those cities existing in the resulting output.

Perhaps you should structure it with the state first, and then all the cities within that state, like:

{
  "CA": [
    "City One",
    "City Two",
   // ...
  ],
  // ...
}

vlucas avatar Aug 18 '15 21:08 vlucas