Is there an ISO standard for city identification?

58,461

Solution 1

I decided to use IATA codes for cities.

Solution 2

There is an ISO standard for Country code, but none (that I can find) for city code. There is, however; a United Nations Economic Commission for Europe United Nations Code for Trade and Transport Locations system of city identification UN/LOCODE.

Edit: Lined out the wrong name, added the slash to the UN/LOCODE name.

Solution 3

In addition to UNLOCODE, there is also the GeoNames database with its own numeric IDs.

This is probably only better than UNLOCODES if you already need to use the information in the GeoNames database or would prefer an integer-based ID system.

Solution 4

For Europe there are also the NUTS codes. It goes into different levels of detail, depending on the country. For some countries like Germany you get the code for cities while for other countries like Spain you get only regions.

Germany's example: https://en.wikipedia.org/wiki/NUTS_of_Germany#Local_administrative_units

You can find the link to each country here: https://en.wikipedia.org/wiki/Category:Nomenclature_of_Territorial_Units_for_Statistics

Share:
58,461

Related videos on Youtube

petRUShka
Author by

petRUShka

Research fellow, mathematician, programmer. Professional code experience from 2005. I've started with coding assembler emulator in m4 for microprocessor development. Developer of several web-apps in Ruby (mostly in Ruby on Rails). Lead developer of internal bank web-based helpdesk for 10-30 thousand of bank employees. Developer of scientific distributed heterogeneous software system (GPGPU: OpenCL (PyOpenCL), Sage Math, Magma). Developer of several open source ruby gems. Developer of following VIM-plugins: vim-magma, vim-gap, vim-pycuda, vim-sage, vim-pyopencl.

Updated on July 11, 2022

Comments

  • petRUShka
    petRUShka almost 2 years

    I want to make service with API that give some info about a city (in any country) by some id.

    What I should choose as id for cities? Does there exist an ISO standard for city identification? If so, where I can get a list of city ids?

    • Marc B
      Marc B almost 13 years
      Offhand the only city identifier system I know of are airport three-letter codes, which'd of course apply only to cities that have an airport.
    • Zecc
      Zecc almost 13 years
      I'm guessing you want something like postal codes. And I think you're out of luck: en.wikipedia.org/wiki/Postal_code#Country_code_prefixes
    • Zecc
      Zecc almost 13 years
      I'd suggest you use a numerical id based on latitude and longitude, by the way. Perhaps add a couple of letters from its name for readability.
    • feklee
      feklee over 10 years
      I am not aware of ISO codes for cities, although I just found in documentation for an airline API: “Flight origin. It can be: City ISO 3 letter code, Airport IATA 3 letter code. If the received code is not found it will be considered an airport code. We prefer city, due to Amadeus works with cities.” My suspicion is that by city codes they mean IATA metropolitan area codes.
    • Evan Carroll
      Evan Carroll over 5 years
      This question is wayyy off topic. Try opendata.stackexchange.com
  • David
    David about 10 years
    petRUShka have you a data base or api to associate IATA and cities? Sorry, I know that some time has passed, but I need that information.
  • petRUShka
    petRUShka about 10 years
    @David, If I remember it right, I used this databases: openflights.org/data.html
  • Incerteza
    Incerteza almost 10 years
    what if there're 2 or more airports in the city? how would encode Moscow which has 3 airports?
  • petRUShka
    petRUShka almost 10 years
    @AlexanderSupertramp, there are separate identification codes for cities. In Moscow case it is MOW or "Moscow-MOW (MOW), Russia" according to openflights.org/html/apsearch
  • Incerteza
    Incerteza almost 10 years
    @petRUShka, sorry, I don't understand. Why is it Moscow-MOW (MOW) for Moscow and not Moscow-Vnukovo (VKO)?
  • Incerteza
    Incerteza almost 10 years
    what would you use for Shanghai? Why exactly that one (whatever you choose)?
  • Brad Mace
    Brad Mace over 9 years
    I don't see more than a handful of cities mentioned in that standard.
  • Cato Minor
    Cato Minor over 8 years
    IATA codes are very helpful for medium-large cities, but for situations dealing with smaller cities (without airports) one will need an alternative identifier.
  • Cato Minor
    Cato Minor over 8 years
    @アレックス Regarding cities with multiple airports, it should be noted that IATA Metropolitan Area Airport Codes exist for cities with multiple mainstream airports. wikitravel.org/en/Metropolitan_Area_Airport_Codes
  • macm
    macm over 7 years
    It is not United Nations but "United Nations Economic Commission for Europe". Database is incomplete. I tested Brazil. Brazil have 5570 cities and this db have only 2374.