Country code

From OpenStreetMap Wiki
(Redirected from Country codes)
Jump to navigation Jump to search

ISO 3166-1

ISO 3166-1 defines codes for the names of countries, dependent territories, and special areas of geographical interest.

Typically used on boundary relation in combination with boundary=administrative + admin_level=2 tags.

Key Description Example
ISO3166-1:alpha2 Two-letter country codes which are the most widely used of the three, and used most prominently for the Internet's country code top-level domains (with a few exceptions) RU
ISO3166-1:alpha3 Three-letter country codes which allow a better visual association between the codes and the country names than the alpha-2 codes RUS

The alpha2 codes (always in capitals in OpenStreetMap) are also used in some tags as subkeys for adding specialized values for specific countries, such as Key:phone#Support for multiple countries.

They are also used as prefixes of keys for tagging features that are specific to countries (e.g. the national classification of schools in France are prefixed by "FR:") or as prefixes of tag values which are only meaningful in a specific country (for example the classification by type of some subnational territorial entities, when the hierarchical admin_level are not sufficient to describe them correctly).

Alpha2 codes differ from ccTLDs
Do not confuse the ISO 3166-1 alpha2 codes with 2-letter Country-or-territory Codes for Top-Level Domain names (ccTLD), as used on the DNS system of the Internet and listed in the IANA database. There are significant historic differences between codes (e.g. .uk for the United Kingdom, whose ISO 3166-1 code is GB), and not all ISO 3166-1 countries/territories have a valid and active ccTLD registry (even if these codes are kept reserved). In addition, many of these codes are open for use worldwide or in several countries; and some ccTLD have been kept working even, if the ISO 3166-1 codes have been retired (for example after splits, merges, or changes of their official name or political regimes).
ISO 3166-1 country codes differ from ISO 639-1 and -2 language codes
Do not confuse ISO 3166-1 country codes with ISO 639-1 or ISO 639-2 language codes (e.g. SE is the country code for Sweden independently of the language used, but the ISO 639-1 code for Swedish is .sv independently of the country where the language is used). As well many dependant territories have an ISO 3166-1 (in addition to ISO 3166-2 region code), which does not match the ISO 639 codes for the language spoken there. Both types of codes may be present simultaneously (but with a different syntax) as subtags within standard BCP 47 tags for identifying locales (not just languages).

Traditionally, ISO 3166 region codes are written in capitals, while ISO 639 language codes are written in lowercase (these conventions should be used in prefixes or suffixes of OSM tags), even if their case is not significant in these two ISO standards (and also not significant in domain names on the Internet).

ISO 3166-2

ISO 3166-2 defines codes for the names of the principal subdivisions (e.g., provinces or states).

Typically used on boundary relation in combination with boundary=administrative tags, but value of admin_level=* (3 or above in OpenStreetMap) depends on the country.

Key Description Example
ISO3166-2=* ISO 3166-2 code consists of two parts, separated by a hyphen:
  • The first part is the ISO 3166-1 alpha-2 code of the country
  • The second part is a string of up to three alphanumeric characters, which is usually obtained from national sources and stems from coding systems already in use in the country concerned, but may also be developed by the ISO itself.
RU-AD

Several countries or territories encoded in ISO 3166-1 do not have listed any national subdivisions in ISO 3166-2: they use their own national standard instead, or they have still not decided how to encode them with a national standard.

The ISO 3166-2 standard may not be fully synchronized with the current official list of subdivisions in a country. There's frequently a very long delay (sometimes several years or more) before ISO 3166-1 and ISO 3166-2 codes are updated. As well, some of these codes may still be valid, but no longer match the primary subdivisions of the country, and an additional set of distinct ISO 3166-2 codes has been added for the new primary level of subdivisions.

Other codes

There are about 200 states and territories, among which 194 are full UN members, internationally recognized as independent states.

United Nations M.49

The UN M.49 standard extends the set of country codes with 3-digit region codes. Some of them, covering international areas, are integrated in other standards (notably by IETF BCP 47 in its associated IANA database, as region subtags for use in locale tags, after the initial subtag defined for a language code or the code of a group of languages). UN M.49 numeric codes defined for individual countries and territories are also part of the ISO 3166-1 code as an alternative to their 2-letter codes (but they must not be used in BCP 47 locale tags, or as country codes in OpenStreetMap feature tags: use only alphabetic codes from ISO 3166-1 or its extensions with ISO 3166-2 subnational division codes).

United Nations LOCODE

The first two-letter code, extracted from the list of five-characters LOCODE is identical to the two-letter code from the ISO 3166-1 standard. These codes are then given a descriptive name of the territory. The remaining 3 letters are used for a specific location in that country. Some locations have a 5-letter LOCODE code but no specific code in ISO 3166-2 (the reverse is also true, notably in Antarctica where only ISO3166-1 codes are defined for all undivided subareas: some countries or regions may still define their own national standard for those areas, and will use specific tags for them, for example the French INSEE or the European Union, preferably by prefixing these specific tags with their ISO3166-1 code such as "FR:" or "EU:" followed by the standard body and some extension for their specific standard).

Universal Postal Union (UPU)

The Universal Postal Union standard body defines codes for countries or territories that are sometimes different from ISO 3166-1: some countries have a 1-letter code which is still preferred on postal addresses (before the national postal code or zip code). However worldwide postal organisations are now also accepting the alpha2 codes from ISO 3166-1, and even recommend it in Europe, instead of older shorter codes initially designed for road vehicles (and in some countries they are even preferred now for automated processing by OCR systems). Postal services of origin countries that are not massively equipped with automated systems still prefer the explicit indication of the country name at end of addresses (preferably in the Latin script and in capitals, or alternatively in an official script of the origin area of posted mails). Using ISO 3166-1 alpha2 codes (with an hyphen before the postal code in the target country) saves one line of address.

International Telecommunication Union (ITU) and the E.164 standard

The ITU-T standard E.164 is used for the international phone plans, and references the country calling codes. Some countries are sharing the same country calling code (such as those in the NAPN numbering plan), and others are using multiple country codes for some of their remote areas, even if they may also be called domestically within the same national numbering plan without using them via an international phone call (with the international selection prefix normally represented by a standard "+" in the recommended E.164 format and in OpenStreetMap. See also Key:phone in OpenStreetMap.

There's also the ITU prefix for call signs, also used now as the source code for prefixes in aircraft registration number. The ITU also defines other codes for regional identification of various communication operators in its GLAD database, including for the aerial and maritime navigation and related equipment and systems.

Identification of vehicles and transport regulation

The identification of road vehicles travelling abroad requires displaying a plate or sign showing another country code which may also be different from the ISO 3166-1 standard (e.g. "F" for France, "I" for Italy). Those codes are also displayed on mandatory driver licences and insurance documents.

The IATA also uses its own code for identifying registered aircraft with a 1-or-2-character code (letters or digits) used as a prefix before an hyphen and the registration number in that country (IATA and OCAI also define 3-character codes for airports, airlines...)

Maritime registries also have their own separate code for identifying naval ships (with a codification of ports of registration). These codes are also still used for the identification of fixed maritime equipments in their associated maritime region (but maritime telecommunication systems use ITU call signs prefixes and their related GLAD codes).

FIPS-10

The FIPS-10 code is now deprecated (its defining US standard has been withdrawn and should no longer be used). It is given a name oriented towards an American description of the territory. The name following it is written (between parentheses) when it is not associated to an fully independent country, member of the United Nations.

The FIPS-10-4 code, however, is still used (with some extensions) by NATO, but is being progressively migrated to a U.S. government–specific profile of the ISO 3166 standard.

European Union

The European Union still uses some legacy codes for identifying countries (e.g. EL and UK for Greece and the United Kingdom respectively, instead of GR and GB in ISO 3166-1). See Countries, languages and currencies: names, codes and listing order (development project for point 7 of the Interinstitutional style guide, Rev. 20 / 1.4.2015).

See also NUTS and LAU for subnational codes of socio-economic regions used in European statistics (not necessarily the same as ISO 3166-2 codes for some administrative subdivisions, but which is not complete enough and not synchronized to match the current national subdivisions). They are also frequently different from codes traditionally used by national statistics agencies, or defined since much longer time in official national nomenclatures: for more details, see Category:Tagging guidelines by country (where available).