Actually I’m coding some web apps for my new employer and I needed a couple of geo information to build on. Since it took some time to create the database from different sources I would like to share them with the rest of the world. (Click on the header for download)
ID | name | code_2 | code_3 | code_num | area | population | region | subregion | latitude | longitude
- „code_2“ is a two char country code
- „code_3“ is a three char country code
- „code_num“ is the numerical UN code
- „area“ is the expanse of the country
- „population“ is from 2005
- „region“ is the UN region code – mainly the continent
- „subregion“ is the UN subregion code
ID | latitude | longitude | name | country
- „country“ is the ID of the corresponding country
There may be some „minor“ cities in this database because of my special scope.
ID | country | coords | coords2
- „country“ is the ID of the corresponding country
- „coords“ is a comma and whitespace separated list of lat/lon for generating polygons (e.g. to create imagemaps in HTML) with up to 16 digits
- „coords2“ is like coords but with reduced accuracy with only 3 digits max
The sources are mainly „free4all“ except the border coordinates, they’re from thematicmapping.com which means that the table „coords“ is released under CC-SA. Everything else is released under the DO WHAT THE FUCK YOU WANT TO LICENSE
This article was published
Mittwoch,, 30. Januar 2013 @ 02:04.
You may want to subscribe to the comments via RSS 2.0 feed.
Post a comment, or create a trackback on your page.
Write a comment / Schreibe einen Kommentar (MySQL Databases with Countries, Borders and Cities)
Please note that comments are moderated and don't appear immediately. If you're reporting a problem or a bug I'll publish them when I started processing your request.
Bitte beachte: Kommentare sind moderiert und erscheinen nicht sofort. Ich veröffentliche Bugreports und Hilferequests erst, sobald ich mich eines Problems oder Bugs angenommen habe.
Thank you very much!! You're doing an essential job for the development of open source software! The following points aren't meant as dogmas but as a clue, decide for yourself what you think could be useful in troubleshooting.
- Please...
- ...state name and version of your operating system / desktop environment
- ...state the version of the program you're using
- ...be detailed in what is happening and what you expected to happen
- ...try to provide some deeper information (like xplanetFX logs or the output of the program when started in a terminal window)
- ...speak to me as a human being, don't think I'm a bot.
Herzlichen Dank!! Fehlerberichte sind essentiell für die Entwicklung von Open-Source-Software! Die folgenden Punkte sind keine Dogmen, sondern sollen eher Anhaltspunkte darstellen; entscheide selbst, ob sie für die Fehlersuche hilfreich sein könnten.
- Bitte...
- ...nenne den Namen und die Version Deines Betriebssystems / Deiner Desktopumgebung
- ...nenne die Version des von Dir benutzten Programms
- ...beschreibe möglichst genau, was passiert und was Du erwartest, was passieren sollte
- ...stelle möglichst tiefergehende Informationen zur Verfügung (xplanetFX Logs oder die Ausgabe des Programms im Terminalfenster)
- ...sprich mit mir, wie mit einem Menschen, ich bin kein Automat.
2 comments on “MySQL Databases with Countries, Borders and Cities”
Hi, I need your help, because you have already worked with these databases I think that you can help me, if you want. What I need is simple, I need a PHP program that have 2 variables (longitude and latitude), then it checks databases and it finds to which country does the cordinates belong and then it prints the name of the country. I would be very thankful if you could write that program.
Thanks in advance
Hey Aleksa,
probably you want to use this tool:
http://api.geonames.org/countryCode?lat=47.03&lng=10.2&username=demo
http://www.geonames.org/export/
Cheers, Markus.