MartinsOnuoha / countriesNowAPI

CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
http://countriesnow.space
MIT License
179 stars 55 forks source link

Duplicate city IDs in countriesStateCity.js #68

Closed patricksebastien closed 3 years ago

patricksebastien commented 3 years ago
{
              "id": 4822,
              "name": "French Guiana",
              "state_code": "GF",
              "cities": [
                  ....
                  { "id": 90328124, "name": 'Camopi', latitude: '3.1688700', longitude: '-52.3352500' },
                  { "id": 90328124, "name": 'Awala-Yalimapo', latitude: '5.741111', longitude: '-53.9277780' },
              ]
          },

Also City IDs:

Please advice.

MartinsOnuoha commented 3 years ago

Hi @patricksebastien Thanks for raising this issue, Ideally I wouldn't advise using the IDs to query since we haven't currently found a way to make the data relational (yet). And the other provided data aren't using unique identifiers.

As for those cities with duplicate IDs in French Guiana I have made a fix for it. and would merge in a bit.

While for the duplicate city IDs. You would notice that those similar IDs are not in the same states, right? So here's a thing you could do, you can streamline the query to search within a selected state first.

It's like having two cities with the same name but in different countries.