The rectangularness of countries

(Update: Now as a world map.)

A Facebook friend recently noted that Turkey was "a remarkably rectangular country." I wondered how it compared to other countries, and this post shows my answers (Turkey is 15th; Egypt is the most rectangular; full table below). I defined the rectangularness of a country as its maximum percentage overlap with a rectangle of the same area, working in the equirectangular projection (i.e., x = longitude, y = latitude). Ideally each country would get its own projection, but equirectangular rectangles feel at least linguistically thematic and are easier to code.

I hand-coded an extremely simple algorithm to find the optimum rectangles (details and R code), and it may not have found the global optimum in all cases. Eyeballing the table below, Italy looks like the biggest country that might be wrong, but there are probably small errors scattered throughout. Countries that consist of many small islands could be horribly wrong – in these cases it's up to me to manually choose which island the start the search from, and I didn't work too hard on these choices.

I used the 1:10m world map shapefile from Natural Earth, and all geopolitical decisions were outsourced to ne_10m_admin_0_countries.shp. Some countries have very distant islands included, making their thumbnail-style maps below indecipherable (Norway has an island near Antarctica!); my plotting also didn't handle crossing 180 degrees of longitude very well, which affects a few countries (e.g., New Zealand, Russia, USA).

Because the shapefile used is designed for large-scale work, small countries are generally represented as quite smooth shapes, likely increasing their rectangularness scores. These scores are labelled 'index' in the table below; an index of 1 would be a perfect rectangle, and 0 would be achieved in a limit of an infinite number of infinitely small islands.

Click on the 'Country', 'Rank', or 'Index' headers to sort by that column.