Of Countries and their Cities

DatabaseCountries

Database Problem Overview


I need a database of Countries and their Cities.

Any idea where I can get such a list?

Database Solutions


Solution 1 - Database

There are quite a few available.

The following has database for 2,401,039 cities

http://www.geodatasource.com/world-cities-database/free

Solution 2 - Database

From all my searching around, I strongly say that the most practical, accurate and free data source is provided by GeoNames.

You can access their data in 2 ways:

  1. The easy way through their free web services.
  2. Import their free text files into Database tables and use the data in any way you wish. This method offers much greater flexibility and have found that this method is better.

Solution 3 - Database

Go through this link http://www.maxmind.com/en/worldcities

It Includes the following fields:

  1. Country Code
  2. ASCII City Name
  3. City Name
  4. Region
  5. Population
  6. Latitude (The latitude and longitude are near the center of the most granular location value returned: postal code, city, region, or country)
  7. Longitude

Solution 4 - Database

Check this out:

Cities of the world database donated by MaxMind.com

The company MaxMind.com1 has agreed to release their cities of the world database under the GPL. The database contains locations by country, city, latitude and longitude. There are over 3,047,000 records in the database. For those of you who have tried the location.module with the zipcodes database from CivicSpace, you will recognize how cool it is and how well this fits with that project and therefore Drupal.

Here's another free one that might help you get started.

Creating and maintaining such a database is quite a bit of work - so anyone who's done it is likely keeping it to themselves, or offering it for a fee.

Solution 5 - Database

http://cldr.unicode.org/ - common standard multi-language database, includes country list and other localizable data.

Solution 6 - Database

https://code.google.com/p/worlddb/downloads/list

Open World Database alpha

This database has multi languages country names, region names, city names and they's latitude and longitude number and country's alpha2 code .

Solution 7 - Database

Solution 8 - Database

You can use database from here -

http://myip.ms/info/cities_sql_database/

CREATE TABLE `cities` (
  `cityID` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `cityName` varchar(50) NOT NULL,
  `stateID` smallint(5) unsigned NOT NULL DEFAULT '0',
  `countryID` varchar(3) NOT NULL DEFAULT '',
  `language` varchar(10) NOT NULL DEFAULT '',
  `latitude` double NOT NULL DEFAULT '0',
  `longitude` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`cityID`),
  UNIQUE KEY `unq` (`countryID`,`stateID`,`cityID`),
  KEY `cityName` (`cityName`),
  KEY `stateID` (`stateID`),
  KEY `countryID` (`countryID`),
  KEY `latitude` (`latitude`),
  KEY `longitude` (`longitude`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

Solution 9 - Database

I was comparing worldcitiesdatabae.info with www.worldcitiesdatabase.com and it appears the latter one to be more resourceful. However, maxmind has a free database so then why buy a cities database. Just get the free one and there is lot of help available on internet about maxmind db. If you put in extra efforts then you can save those few bucks :)

Solution 10 - Database

This service returns Countries (name,code) and cities for any country as REST, SErvice. You can also download database and sample REST service

http://tecorange.com/content/world-countries-and-cities-restjson-service-12-months-subscription

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHarsha M VView Question on Stackoverflow
Solution 1 - DatabasepyfuncView Answer on Stackoverflow
Solution 2 - DatabaseVishnu V LeelakrishnanView Answer on Stackoverflow
Solution 3 - DatabaseAjit KumarView Answer on Stackoverflow
Solution 4 - Databasemarc_sView Answer on Stackoverflow
Solution 5 - DatabaseKuvalda.Spb.RuView Answer on Stackoverflow
Solution 6 - DatabasenelaaroView Answer on Stackoverflow
Solution 7 - DatabaseSum NoneView Answer on Stackoverflow
Solution 8 - Databaseuser2253362View Answer on Stackoverflow
Solution 9 - DatabaseGanesh SView Answer on Stackoverflow
Solution 10 - DatabaseYiannisView Answer on Stackoverflow