dr5hn / countries-states-cities-database

🌍 Discover our global repository of countries, states, and cities! 🏙️ Get comprehensive data in JSON, SQL, PSQL, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities
https://dr5hn.github.io/countries-states-cities-database/
Open Data Commons Open Database License v1.0
7.37k stars 2.56k forks source link

Missing State and City Data #329

Closed AsadAyyub closed 2 years ago

AsadAyyub commented 2 years ago

Following Country have missing state or City Data

Albania Algeria Antigua And Barbuda Argentina Azerbaijan Bahamas The Bahrain Bangladesh Barbados Belgium Bermuda Bhutan Bosnia and Herzegovina Botswana Burkina Faso Burundi Cape Verde Chad China Colombia Congo Cote D'Ivoire (Ivory Coast) Czech Republic Democratic Republic of the Congo Equatorial Guinea Fiji Islands Finland France Georgia Greece Guinea Guinea-Bissau Hong Kong S.A.R. Hungary Indonesia Ireland Italy Kenya Kosovo Kyrgyzstan Laos Latvia Lithuania Luxembourg Macedonia Madagascar Malawi Maldives Mali Malta Marshall Islands Mauritania Mauritius Mexico Micronesia Moldova Monaco Mongolia Montenegro Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Korea Norway Oman Pakistan Palau Panama Papua new Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts And Nevis Saint Lucia Saint Vincent And The Grenadines Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Solomon Islands Somalia South Africa South Korea Spain Sri Lanka Sudan Suriname Swaziland Sweden Switzerland Syria Taiwan Tajikistan Tanzania Thailand Togo Tonga Trinidad And Tobago Tunisia Turkey Turkmenistan Tuvalu Uganda Ukraine United Arab Emirates United Kingdom United States Uruguay Uzbekistan Vanuatu Venezuela Vietnam Yemen Zambia Zimbabwe

dr5hn commented 2 years ago

@AsadAyyub

Did you mean there are 0 states and cities inside those countries or only some?

dr5hn commented 2 years ago

Closing issue until answered.

ozziest commented 2 years ago

@dr5hn , I can answer it for Turkey.

Turkey doesn't have any states, we only have cities.

alexshikov commented 1 year ago

@dr5hn Monaco cities list is empty when mostly it should contain a few.

aprilmintacpineda commented 11 months ago

Yes, there are entries without states / cities.

const fs = require('fs/promises');
const axios = require('axios');

function main () {
  const { data } = await axios.get(
    "https://raw.githubusercontent.com/dr5hn/countries-states-cities-database/master/countries%2Bstates%2Bcities.json"
  );

  data.forEach(async (country) => {
    const filename = path.join(__dirname, "./empties/", `${country.iso3}.json`);

    if (!country.states.length) {
      await fs.writeFile(filename, JSON.stringify(country, null, 2));
    } else {
      for (const state of country.states) {
        if (!state.cities.length) {
          await fs.writeFile(filename, JSON.stringify(country, null, 2));
          break;
        }
      }
    }
  });
}

main();

Not sure why that is. There are 1.5k+ entries and the generated JSON is too long so here's a code you can run to check them out.