Capital cities in the centre of the country

What makes a city a capital is more complicated than it seems. In most cases, the capital is the prime economic, cultural or intellectual centre that becomes the focal point of political power. This is the case for example for London, Madrid, Moscow, Rome, Beijin, Stockholm, Tokyo, and Vienna.

Cities which are disproportionately larger than any other city in the country, are called Primate Cities. Some examples: Accra, Athens, Belgrade, Bratislava, Brussels, Bucharest, Budapest, Buenos Aires, Bujumbura, Cairo, Copenhagen, Dublin, Kigali, Lima, Lisbon, London, Madrid, Manila, Montevideo, Mexico City, Nairobi, Paris, Prague, Riga, Santiago, Seoul, Skopje, Sofia, Stockholm, Tirana, Tokyo, Taipei, Ulaanbaatar, and Vienna.

All primate cities are however not always the capital. Ottawa, the capital of Canada, is not the country’s largest city. So it is for Washington DC (USA), Canberra (Australia), Brasilia (Brazil), Beijing (China), etc.

The capital city is often defined by constitution. De facto capital cities are, for example, such as Bern, Edinburgh, Lisbon, London, Paris, Wellington.

While most capital cities are chosen from an existing city, some countries have decided to create new cities to set their capital cities there. These cities are called “planned cities”. Here’s a list of planned capitals: La Plata, Buenos Aires Province, Argentina, Abuja, Nigeria (1991); Aracaju, Sergipe, Brazil (1855); Ankara, Turkey (1923); Austin, Texas, USA (1839); Belmopan, Belize (1970); Belo Horizonte, Minas Gerais, Brazil (1897); Dhaka, Bangladesh (1971); Brasília, Brazil (1960); Canberra, Australia (1927); Goiânia, Goiás, Brazil (1933); Indianapolis, Indiana, USA (1825); Islamabad, Pakistan (1960); Frankfort, Kentucky, USA (1792); Jefferson City, Missouri, USA (1821); Jhongsing New Village, Taiwan (1955); New Delhi, India (1911); Oklahoma City, Oklahoma, USA (1889); Ottawa, Ontario, Canada (1857); Palmas, Tocantins, Brazil (1989); Quezon City, Philippines (1948–76); Raleigh, North Carolina, USA (1792); Valletta, Malta (1571); Washington D.C., USA (1800); and Wellington, New Zealand (1865).

The reason for creating a new city as a capital can be overcrowding, the search for a better climate for the capital city, or a new city as a compromise between two competing cities. Canberra, for example, was created as Sydney and Melbourne competed for being Australia’s capital.

While the capital attracts political power, not all capitals are the seat of the country’s government. The Netherlands, which capital is Amsterdam, has its seat in The Hague. South Africa has three capitals:

There is also a case where a city is claimed as a capital by two countries. Jerusalem is both claimed by Israel and by Palestine.

Before continuing through the typology of capital cities, let’s go straight to the main topic of this article: are the capital located in the centre of their country? In other word, are they located at equal distance of all of their border? We could go from the hypothesis that a capital should be central as they minimize the distance from every point of the country. We know for sure that the population is not equally distributed in every country but from a geometric perspective, let’s find out how the capitals are located within their country!

Centroid or centre of bounding circle?

I used two different approaches to find out the “centre”  point of the countries. One is to determine the centroid, the other is the centre of the bounding circle. They two give different perspectives of the problem.

The idea is to see how far away the centre point is from the current capital. We could make a simple rule saying it is only based on the distance in kilometer between both points. But for the same distance, the capital seems more excentered for small countries than it is for large countries. We need to normalize this distance. The rule I found is to divide this distance by the radius of the minimum bounding circle. I furthermore want to calculate a score from 0 to 100, where score 0 corresponds to the capital city placed on the border of the minimal bounding circle and score 100 for the capital city coincides exactly with the central. I came to the following formula:

100 - (DISTANCE(CENTRAL_POINT, CAPITAL_CITY) / RADIUS_OF_BOUNDINGCIRCLE) * 100

What do we get as results?

Centroids

Here are the results:

 rank | country_name | city_name | distance | area | score
------+----------------------------------------+---------------------+----------+--------------+------
 1 | PALAU | Koror | 6.199 | 497.464 | 98.19
 2 | SPAIN | Madrid | 18.243 | 498638.682 | 97.33
 3 | ERITREA | Asmara | 14.888 | 121227.243 | 96.37
 4 | New Caledonia (FRANCE) | Noumea | 29.309 | 18913.831 | 96.12
 5 | Anguilla (UK) | The Valley | 1.637 | 85.231 | 94.85
 6 | BANGLADESH | Dhaka | 19.983 | 139726.063 | 94.79
 7 | BURKINA FASO | Ouagadougou | 23.905 | 272912.828 | 94.61
 8 | COSTA RICA | San Jose | 13.594 | 51206.299 | 94.10
 9 | NAMIBIA | Windhoek | 48.893 | 824094.245 | 93.45
 10 | SAO TOME & PRINCIPE | Sao Tome | 8.763 | 985.060 | 91.92
 11 | SOLOMAN ISLANDS | Honiara | 71.722 | 29002.155 | 91.50
 12 | SLOVENIA | Ljubljana | 15.178 | 20276.985 | 90.11

Click here to get the full list.

Palau tops the list! It is a small island country whose population is spread accross 250 islands in the Pacific. Spain, as a continental country, takes number 2 as a well chosen centre capital city. Eritrea is the third in our list.

IMPORTANT NOTICE: In order to treat countries equally, whether they contains remote islands or not, I decided to only keep the main mainlands. The centroid of the USA, for example, would have been placed somewhere near to the pacific if we had kept remote Alaska and Hawaii. So would have been for Spain when having kept the Canary Islands. As said, main mainland can contain islands such as for the country islands, Greece with its rosary of islands, etc. See details in the Recipe section at the bottom of the article.

Here are the maps to illustrate.

Who are the best pupils in the class?

n°1: Palau
n°1: Palau
n° 2: Spain
n° 2: Spain
n3: Eritrea
n°3: Eritrea
n°4: New Caledonia (France)
n°4: New Caledonia (France)
n°4: Anguilla
n°5: Anguilla
n°6: Bangladesh
n°6: Bangladesh
n°7: Burkina Faso
n°7: Burkina Faso
n°8: Costa Rica
n°8: Costa Rica
n°9: Namibia
n°9: Namibia
n°10: Sao Tome & Principe
n°10: Sao Tome & Principe
n°11: Soloman Islands
n°11: Soloman Islands
n°12: Slovenia
n°12: Slovenia

Here’s the entire world.

Centroid scores
Centroid scores

Centre of minimum bounding circle

Different approach, different results. The ranking is a bit shaken up as we’re now taking into account the distance between the capital city and the centre of the minimum bounding circle of the country.

IMPORTANT NOTICE: In order to treat countries equally, whether they contains remote islands or not, I decided to only keep the main mainlands. The centre of the minimum bounding circle the USA, for example, would have been placed somewhere near to the pacific if we had kept remote Alaska and Hawaii. So would be the minimum bounding circle be stretched for Spain when having kept the Canary Islands. As said, main mainland can contain islands such as for the country islands, Greece with its rosary of islands, etc. See details in the Recipe section at the bottom of the article.

Who are the best pupils in the class?

 rank | country_name | city_name | distance | area | score
------+----------------------------------------+---------------------+----------+--------------+------
 1 | BANGLADESH | Dhaka | 11.428 | 139726.063 | 97.02
 2 | MADAGASCAR | Antananarivo | 36.872 | 591620.980 | 95.20
 3 | ITALY | Rome | 32.601 | 301144.362 | 94.91
 4 | BELIZE | Belmopan | 8.095 | 22279.828 | 94.59
 5 | BELGIUM | Brussels | 15.803 | 30651.885 | 91.28
 6 | New Caledonia (FRANCE) | Noumea | 68.260 | 18913.831 | 90.96
 7 | HUNGARY | Budapest | 31.083 | 93018.734 | 90.39
 8 | THAILAND | Bangkok | 78.726 | 514961.736 | 90.32
 9 | GREECE | Athens | 43.082 | 121835.310 | 90.26
 10 | QATAR | Doha | 12.642 | 11544.145 | 87.31

Click here to get the full list.

Bangladesh is on the top of our list with its capital city located just as far as 11 km !

Here for the maps:

n°1: Bangladesh
n°1: Bangladesh
n°2: Madagascar
n°2: Madagascar
n°3: Italy
n°3: Italy
n°4: Belize
n°4: Belize
n°5: Belgium
n°5: Belgium
n°6: New Caledonia
n°6: New Caledonia
n°7: Hungary
n°7: Hungary
n°8: Thailand
n°8: Thailand
n°9: Greece
n°9: Greece
n°10: Qatar
n°10: Qatar

Here’s the entire world.

Distance between the capital city and the centre of the minimum bounding box
Distance between the capital city and the centre of the minimum bounding box

Recipe: To reproduce at home!

All the script to reproduce are here.

Get the data

We need the capital cities and the countries.

We found detailed country borders here (per continent):

  • https://hiu.state.gov/data/data.aspx?view=table&sort=title+asc

For capital cities, we found a shapefile with most of the cities of the world here:

  • http://www.arcgis.com/home/item.html?id=dfab3b294ab24961899b2a98e9e8cd3d

This last shapefile has to be cleaned out as it contains both cities and capital cities. I used QGIS for filtering out the capital cities (can be done in PostGIS after the upload as well).

Create the database

CREATE DATABASE worldadmin WITH OWNER themagiscian;

Upload to PostGIS

We use the famous shp2pgsql tool

shp2pgsql -s4326 -d -S -ggeom -I "D:\GIS\themagiscian.com\Blog\Articles\0006_CENTRALIZED_CAPITALS\Data\CAPITAL_CITIES.shp" public.capital_cities | psql -Uthemagiscian -h192.168.1.87 -dworldadmin
shp2pgsql -s4326 -d -ggeom -e -I "D:\GIS\GEODATA\World\WORLD_COUNTRIES.shp" public.world_countries | psql -Uthemagiscian -h192.168.1.87 -dworldadmin

Clean the data

A lot of things have to be cleaned out. Here are they (please see this script for the full stack of things to clean out).

  • The Fiji islands contain three islands crosses the whole world map (as they sit on the 180 meridian line). Solution: Split all the polygons individually and merge them into a new unique multipolygon entity
  • Some countries extents beyond the 180° meridian line. The calculus of the central point would hence be somewhere in the Atlantic. We do not want that and we add 360° to all these countries (FIJI, RUSSIA, TUVALU, KIRIBATI).
  • The strategy is to keep only the mainlands for the calculations. For example, if we keep the whole USA, the central points would be near the Pacific coast as we have to take into account Alaska and Hawaii. For other countries, we delete the small remote islands.
  • After the whole cleaning work, we dissolve the countries so they are unique multipolygons
  • We add a common country name attribute to the capital cities layer. We need it in order to perform joins between them and the countries.

Create the minimum bounding circles

There’s a simple function in PostGIS for the creation of the minimum bounding circle

ST_MinimumBoundingCircle

Here’s the full query for creating the minimum bounding circle and having all the necessary attributes:

DROP TABLE world_countries_mboundingcircle;
CREATE TABLE world_countries_mboundingcircle AS SELECT 
ccc.country_name, cc.fips_cntry, cc.city_name, ST_MinimumBoundingCircle(wcw.geom) geom
FROM capital_cities cc 
JOIN centroid_capital_cities ccc ON ccc.country_name = cc.country_name
JOIN world_countries_work wcw ON wcw.name = ccc.country_name;

Create centroids and centre of the minimum bounding circles

The key for our calculations are the centre points. We need to create the centroids:

DROP TABLE centroid_capital_cities;
CREATE TABLE centroid_capital_cities AS 
SELECT wcw.name country_name, cc.city_name capital_city, ST_Centroid(wcw.geom) geom FROM world_countries_work wcw JOIN capital_cities cc ON wcw.name = cc.country_name;

And here the centres of the minimum bounding circles:

DROP TABLE center_circle_capital_cities;
CREATE TABLE center_circle_capital_cities AS 
SELECT mbc.country_name country_name, mbc.city_name capital_city, ST_SetSRID(ST_MakePoint(((ST_XMAX(mbc.geom) + ST_XMIN(mbc.geom))/2), ((ST_YMAX(mbc.geom) + ST_YMIN(mbc.geom))/2)), 4326) geom FROM world_countries_mboundingcircle mbc;

Calculate the scores

The core engine of our article. Remember, the formula we want to apply to have a score between 0 and 100  is the following:

100 - (DISTANCE(CENTRAL_POINT, CAPITAL_CITY) / RADIUS_OF_BOUNDINGCIRCLE) * 100

The calculation of the score using the centroids is the following:

DROP TABLE SCORES_CENTROID;
CREATE TABLE SCORES_CENTROID AS
select rank() over(order by score desc), country_name, city_name, distance, area, score from (
SELECT 
ccc.country_name, cc.city_name, ST_Distance_Spheroid(ccc.geom, cc.geom, 'SPHEROID["WGS 84",6378137,298.257223563]')/1000 distance, wc.area, 100 - (ST_Distance_Spheroid(ccc.geom, cc.geom, 'SPHEROID["WGS 84",6378137,298.257223563]')/1000/((ST_Perimeter(ST_MinimumBoundingCircle(wc.geom), true)/1000)/(2*pi())))*100 score
FROM capital_cities cc 
JOIN centroid_capital_cities ccc ON ccc.country_name = cc.country_name
JOIN world_countries_work wc ON wc.name = ccc.country_name) scores
ORDER BY score desc;

And when using the centres of the minimum bounding circles we have following formula:

DROP TABLE SCORES_CENTRE;
CREATE TABLE SCORES_CENTRE AS
select rank() over(order by score desc), country_name, city_name, distance, area, score from (
SELECT 
ccc.country_name, cc.city_name, ST_Distance_Spheroid(ccc.geom, cc.geom, 'SPHEROID["WGS 84",6378137,298.257223563]')/1000 distance, wc.area, 100 - (ST_Distance_Spheroid(ccc.geom, cc.geom, 'SPHEROID["WGS 84",6378137,298.257223563]')/1000/((ST_Perimeter(ST_MinimumBoundingCircle(wc.geom), true)/1000)/(2*pi())))*100 score
FROM capital_cities cc 
JOIN center_circle_capital_cities ccc ON ccc.country_name = cc.country_name
JOIN world_countries_work wc ON wc.name = ccc.country_name) scores
ORDER BY score desc;

As all of the process seems complicated at first sight, it is not anymore once digged into it. If you have any problem, do not hesitate to contact me!

Cheers,

Daniel

4 thoughts on “Capital cities in the centre of the country

  1. Excellent post! I arrived after a Twitter discussion about excentricity of capital cities. Served me to show that Madrid is an unusually centered capital.

    Furthermore, a friend has pointed me out that Koror is no longer Palau’s capital, but Ngerelmud.

Leave a Reply

Your email address will not be published.

Proove you're not a robot * Time limit is exhausted. Please reload CAPTCHA.