Frage

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?

War es hilfreich?

Lösung 2

I decided to use IATA codes for cities.

Andere Tipps

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.

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.

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

You may use ISO 3166-2 standarts: http://en.wikipedia.org/wiki/ISO_3166-2

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top