Main page > Data

Continents

This page is an addition to the countries page. It offers computer-readable data files with information on earth continents. Here you can get a list of continents, continent names in several languages (right now only English and German) and mappings from countries to continents, including population and area information for each country for each continent which it is part of.

Continent list

The most simple file is the list of continents continents.txt. The file is an ASCII text file, one continent per line, three items per line separated by a tab character. The items are, in order: ID integer value, two letter abbreviation and English name. Lines starting with # contain comments and are supposed to be skipped. This list differentiates between seven continents: Africa, Asia, Antarctica, Australia and Oceania, Europa, North America and South America. Other continent definitions exist.

Continent names

The second file, about as simple as the first one, is continentnames.txt. It is a Unicode text file (big endian byte order, with BOM marker) with DOS line endings, storing four items per line: continent ID from the previous file, language used for the continent name as ISO 3166-1 abbreviation, language used for the continent name as a numerical number into the language table also available from this site, and finally the name of the continent in that particular language. Right now, only German is supported in that file.

Mapping countries to continents

The text file country2continent.txt does the mapping from country to continent. Note that each country has one or more lines, because a country can belong to one or more continents (examples for the latter are Russia and Turkey). This file contains ASCII text. Its items are: the country ID number, the ID number of the continent it belongs to, the area that the country has on that continent (in square kilometers), the population that country has on that continent and finally comments, including the country's name in English.

For most countries there is one entry with its continent, population and area. For countries which spread over two continents, there are two entries. Example: Azerbaijan, which belongs to Europa and Asia. It has two entries:

234	3	46870	4129127	Azerbaijan (Asian part)
234	5	39730	4198491	Azerbaijan (European part)

It shows that Azerbaijan has a slighly larger Asian area (46870 sq. km), compared to its European area (39730 sq. km). However, the European part has more inhabitants.

The two example entries for Azerbaijan also demonstrate that you shouldn't use the fifth column as the country name, it's just a comment. Instead, take the name from countries.txt or countrynames.txt using the ID (in this case 234).

For area and population of a given country, add the corresponding columns of all rows with the country's ID.

Mappings are based on geographical terms, not cultural or national ones.

Data is taken from the English Wikipedia. Especially population data may quickly be out of date or inaccurate for other reasons.