An updated version of the Russian-language database of countries and cities has been published. The main change - removed a large number of duplicate cities.
The database is distributed in two versions: “
Countries and cities ” (23Mb, after installing ~ 130Mb) and “
Countries only ” 2Mb, after installing ~ 12Mb). Also in the archives is a small example of using the database in php.
The accuracy of determining the country ~ 99%, the accuracy of determining the cities on average ~ 95%. Whether it is a lot or a little depends on the tasks that you are going to solve with the help of this base.
')
Test demo -
determine your country and city by IP-addressWork demo -
city ​​substitution in the form of air ticket searchTo install the database, I recommend using programs like
mysqldumper or via ssh to execute
mysql –p –user database <file.sqlThe “
update script ” (~ 300Kb, after installing ~ 1Mb) is adapted only for the current version of the database (December 2011),
it is impossible to update with the previous versions with its help . To update the database, import the geo_update_2011_12.sql file (contains two technical tables), download the latest archives with maxmind and ipgeobase and run update_maxmind.php and update_ru.php from the console. Update maxmind database of cities takes 20-30 minutes.
In the directory of countries there are islands that are not independent states, but significantly removed from their metropolitan areas.
In the directory of cities errors are possible (including duplicates).
In the “Only countries” database there are IP blocks of only European countries (from ipgeobase, net_euro table) and countries around the world (including European, from maxmind, net_country_ip table). Theoretically, European countries should be more accurately determined by the first option, but there was no practical test.
Ideas to improve and improve the quality of the base are welcome.
If while testing the demo you found an error - report the verified IP address.Some statistics
In the current version of the base
87,501 settlements.
The number of settlements in different countries:A country | amount |
---|
USA | 28,991 |
Germany | 16,264 |
Australia | 4,871 |
France | 4.613 |
Spain | 3,253 |
Canada | 3,074 |
Brazil | 2,926 |
Russian Federation | 2.301 |
Switzerland | 1,831 |
Mexico | 1,572 |
Portugal | 1,349 |
Ireland | 1.269 |
Argentina | 1,189 |
Japan | 851 |
Poland | 712 |
Italy | 699 |
Bulgaria | 659 |
Great Britain | 652 |
Colombia | 540 |
Ukraine | 531 |
Belgium | 447 |
China | 401 |
Luxembourg | 387 |
India | 365 |
Austria | 346 |
Turkey | 306 |
Serbia | 293 |
South Africa | 292 |
Chile | 281 |
Hungary | 269 |
Kazakhstan | 266 |
New Zealand | 262 |
Czech | 216 |
Romania | 215 |
Algeria | 190 |
Croatia | 170 |
Venezuela | 144 |
Belarus | 138 |
Moldova | 129 |
Greece | 128 |
Peru | 126 |
Lithuania | 115 |
Estonia | 115 |
Sweden | 113 |
The Republic of Korea | 112 |
Guatemala | 108 |
Philippines | 101 |
Israel | 99 |
Latvia | 93 |
Salvador | 92 |
Netherlands | 88 |
Iran | 87 |
Puerto rico | 82 |
Ecuador | 78 |
Dominican Republic | 75 |
Costa Rica | 74 |
Morocco | 73 |
Slovakia | 70 |
Indonesia | 69 |
Pakistan | 67 |
Honduras | 66 |
Trinidad and Tobago | 63 |
Mauritius | 61 |
Finland | 59 |
Bosnia and Herzegovina | 59 |
Uruguay | 52 |
Nigeria | 52 |
Macedonia | 51 |
Egypt | 50 |
Jamaica | 50 |
Panama | 49 |
Tunisia | 48 |
Paraguay | 47 |
Ivory Coast | 45 |
Armenia | 44 |
Nicaragua | 40 |
Vietnam | 38 |
Barbados | 38 |
Slovenia | 37 |
Malaysia | 37 |
Uzbekistan | 34 |
Iraq | 31 |
In other countries, less than 30 localities.Added by:Fixed a bug in the definition of some Russian and Ukrainian cities.