> We cannot use those (xi,yi)(xi,yi) directly, because they come from a Mercator projection of the earth, thus they are distorted. I had to apply a transformation to them in order to get coordinates that aren’t distorted. In order to do that I used the pyproj library.
Nitpick: you apply a transformation where they are less distorted. There is no "distorsionless" mapping from R^2->sphere. A more accurate approach would be to use spherical geometry to calculate the actual areas, but I doubt that it would change the values too much though.
Also I would be curious what was the exact projection you used and how you choose the parameters for each country.
What I do is the following: For each country, I transform its points from the equirectangular projection I'm given to an azimutal projection centered in some point (that depends on the country).
That point is obtained by computing the midpoint of two random points from the border of the country.
I know it is not the best (if the country is not convex, then the midpoint isn't necessarily inside it), but it works. The code is at the end of the post, if you want to take a look at it.
Thanks for pointing that out though, I'm going to add this to the post.
Edit: you were right, it wasn't even the Mercator projection, it was the equirectangular projection. Thank you!
Also Natural Earth provides data in WGS84 which is an unprojected, geographic system. They are latitude and longitude and have pretty much nothing to do with Mercator projections.
edit: They used "azimuthal projection centered in each country". That's good!
Neither this, nor the post it's inspired by, is as interesting to me as a question with a much simpler-to-calculate answer: what's the smoothest (i.e. lowest fractal-dimension, smallest surface-area-to-volume ratio) country?
At the top would be some country with artificially-defined borders that have not since been reshaped by war or treaty. At the bottom would likely be the most "historied" country.
(Then again, at the bottom might just be Canada or Russia, since they have so much jagged coast to count. Perhaps, for the parts of a country that abut international waters instead of another country, we could use the political boundaries of the country's coastal waters surrounding that coast, rather than the boundaries of its landmass.)
Would be interesting as even natural borders are very different. I remeber South Africa (very straight coastline) vs Ireland (very fractal coastline) being used as an example for complexity in nature.
For some reason Egypt has shown up as the most rectangular and now one of the most round countries. Goes back to how the average person's definition of these terms isn't capture by the metric. When I say a country is "rectangular" I'm thinking about straight lines and sharp corners. "Round" I guess should be the absence of corners?
Agreed. This feels like more a measure of how "blobby" a country is - the extent to which its territory is clustered around its centre. Countries that score lowest on this metric are island federations and long, thin countries like Chile or Western Sahara.
There's nothing wrong with that. A square is very "round" in the sense that it is very close to a circle in terms of shape, compared to all other possible polygons out there.
> A square is very "round" in the sense that it is very close to a circle in terms of shape, compared to all other possible polygons out there.
Regular convex n-gons approach a circle in terms of shape as n increases. A square represents n=4. For any n>4, the polygon will be closer to a circle in terms of shape than a square, no?
ADDED: Right. Thank you for pulling my head out of abstract, regular convexness. IRL FTW. :-)
Yes, but you are only looking at regular N-gons, while the person you are responding to is considering all polygons.
Square countries are relatively close to being circular compared to the many highly irregular countries out there, not compared to other regular N-gons.
Watch out for over-generalization, especially when the thing you're generalizing is a geographic shape.
(In GIS, "generalization" is what you might also call "simplification" - reducing the vertex count of the borders so you have less data to deal with.)
Take Scarborough Reef (aka Scarborough Shoal) for example: #6 on the list with a Roundness of 0.9. It only has four vertices, a simple squarish quadrilateral. Is that what it is really shaped like? You be the judge:
I don't recognize France on spot 156. As for United States on spot 121, Netherlands on spot 93, Denmark on spot 97 etc. it looks like they have included all overseas territories. But it does look weird.
France seems to be centered on Siberia or something.
You can see Polynesia at bottom right, Southern and Antarctic Lands at bottom left, mainland at center left, and the territories in the Americas at the top.
There's actually a lot of overlap. See Nauru (2, 10), Sierra Leone (1, 14), Uruguay (9, 13) etc.
It's interesting, I think both of these metrics reward largely the same thing, independent of actual approximate shape, which is a lack of irregularity in their borders and many degrees of symmetry.
The borders of France, and other colonial powers, are considered to include all of their overseas territories. This is a bit easier to see with the USA.
In practice I don't think this affects the computation much, since the overseas territories have relatively small areas.
You can fully specify any rectangle by its length and width (and the fact that it's a rectangle...). They're all very round compared to arbitrary shapes.
Nitpick: you apply a transformation where they are less distorted. There is no "distorsionless" mapping from R^2->sphere. A more accurate approach would be to use spherical geometry to calculate the actual areas, but I doubt that it would change the values too much though.
Also I would be curious what was the exact projection you used and how you choose the parameters for each country.