Where can I download a list of world cities and towns by ISO 3166-2 state code?

29,770

Solution 1

I was searching for information on the same issue and I've just discovered the UN LOCODE standard:

Currently, UN/LOCODE includes over 97,114 locations in 249 countries and installations in international waters. It is used by most major shipping companies, by freight forwarders and in the manufacturing industry around the world. It is also applied by national governments and in trade related activities, such as statistics where it is used by the European Union, by the UPU for certain postal services, etc

You can download for free the full LOCODE list in MS Access .mdb, .csv and .txt formats.

Hope this will help you. :)

Regards, -- Wayfarer

Solution 2

A search on GitHub leads some dataset https://github.com/search?q=iso%203166%202

Here you find it in CSV for instance https://github.com/fran-diaz/ISO-3166

Share:
29,770

Related videos on Youtube

Ivan
Author by

Ivan

Updated on July 30, 2020

Comments

  • Ivan
    Ivan almost 4 years

    World countries and their standard codes are listed in ISO 3166-1. States (whatever are they called in different countries ("lands" in Germany, "federation subjects" in Russia etc.)) of the countries and their codes are defined in ISO 3166-2. But I couldn't find anything like this for cities.

    What I need is a table listing of world cities where it would be also shown in what particular state are they situated and the state would be designated by an ISO 3166-2 code.

    I have managed to find such a table listing USA cities (here) but I also need other countries data.

  • Steve
    Steve over 9 years
    issue with this file is there's no relation between regions/locations/subdivisions and cities so you get all cities but don't know to which regions they relate!!
  • Wayfarer
    Wayfarer over 9 years
    Yes, Steve, it does: it is on the sixth column, though I must admit that it's not complete. It is not available for all the locations and it may use a non standard code. For example, for Spain that column refers to the province without mentioning at all the upper division (autonomous communities) and also some locations have that field void. The locations that have that field filled use the ISO 3166-2:ES standard without the country code prefix.
  • Steve
    Steve over 9 years
    well in the doc they say subdivision is in 4th column and if take a look into this column you'll notiece several locations have their subdivisions empty. Also, if you look into the SubdivisionCodes table or file you will see there's no relation with the aformentioned subdivision codes!
  • Wayfarer
    Wayfarer over 9 years
    Well, it is really confusing: in the documentation they indeed say SubDivision is the 4th column, the web listing inserts a first column named Ch (Change) thus moving SubDivision column to the 5th, and the CSV file (which is the one I use) insert the Ch column plus splits the Locode column into two different columns for Country and Location code so SubDivision column becomes the 6th. It's crazy :-)
  • Wayfarer
    Wayfarer over 9 years
    Also, the web interface help says the following: Column "Subdivision" is intended to contain the ISO 1-3 character alphabetic and/or numeric code for the administrative division of the country concerned (state, province, department, etc.), as included in International Standard ISO 3166-2/1998 and when deemed desirable to enhance the use of the code, or when requested by the country concerned. The country code element is not shown in this column. It's filled only on request, that's why it's empty in most cases unece.org/fileadmin/DAM/cefact/locode/Service/LocodeColumn.h‌​tm
  • Steve
    Steve over 9 years
    right they said: "when requested by the country concerned"
  • Rabin
    Rabin over 8 years
    Thank you, I found the Debian resources on one of git project much more usable then the other resource.
  • Jaider
    Jaider almost 7 years
    This could be a great resource but I cannot use since I think is not accurate: Missing cities e.g. Sevilla, Magdalena Colombia, it is not there, maybe it is too small???. Missing Department e.g. Barranquilla (ATL) Geo location is off e.g. Bogota 0436N 07405W google.com/maps/place/…
  • Graham Perrin
    Graham Perrin over 2 years
    Thank you. The CSV example is no longer available, I wondered whether <github.com/topics/iso3166-2?o=desc&s=updated> might find a suitable alternative … at a glance, unfortunately not.