Hacker News new | past | comments | ask | show | jobs | submit login
What is the roundest country? (gciruelos.com)
120 points by gciruelos on July 27, 2016 | hide | past | favorite | 44 comments



> 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.)


Mandelbrot on the "fractal dimension" of coastlines:

http://users.math.yale.edu/~bbm3/web_pdfs/howLongIsTheCoastO...

The figure under "The Richardson Effect" on this page has some examples of how measured length of coastlines scales with the the scale of measurement:

http://www.vanderbilt.edu/AnS/psychology/cogsci/chaos/worksh...


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.


Coastlines vary even within the same country. See South Korea (rank 51). Very smooth in the east, crazy fractals in the southwest.


At the bottom might be more defined by geography than anything else. For example, Norway.


Right, the fractal structure is of coastlines, not borders in general.


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.


Many countries are irregular polygons like Chile. Thus a square is very close to a circle, relative to the other shapes.


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:

https://commons.wikimedia.org/wiki/File:Scarborough_Shoal_La...


Yes, I know, that is a pity. I didn't simplify anything though, I use all the vertices that the dataset gives me, the dataset is the problem here.


I wonder if they will get the same result if they plot the countries as shapes in a physics engine and roll them down the hill.


There's a half-baked mobile game idea in that!


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.


169 United Kingdom is another.


So, Egypt is both round (20) and rectangular (1)?

Compare: http://pappubahry.com/misc/rectangles/


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.


What happened to France?


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.


I don't think "Metropolitan" France would be 156th.


We went on strike


LaTeX nitpick: use \text for function names, like \text{roundness}, or else you have roundness which means r times o times u...


Nice writeup but it seems like there should be a closed analytical solution vs. an iterative one.


It seems a bit counter-intuitive that Vatican is 4th roundest, and 2nd rectangularest


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.


Nauru is the 2nd roundest (0.923) and the 10th most rectangular (0.917). http://pappubahry.com/misc/rectangles/


Swaziland is a good candidate for the "roundest country". Macedonia and Qatar wouldn't be too far behind either.


11, 21 and 103 respectively, according to this (table in the middle).


Hadn't see the table before my reply. I was just thinking about the countries from the ones that i remembered. Thanks for pointing me to it!


Weird, I missed it too when I first read the article, even though it is bang in the middle. They should have mentioned it in the text maybe.


possibly Poland?


Poland is mentioned as 5th in the article.


I had no idea what or where Serranilla Bank (#70) was. Something new to learn everyday. :)


Why do France looks like little dots???


Overseas dependencies.


Nauru is the 2nd roundest I know.


I dont know.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: