Mathematica has already a specific function, RegionCentroid
, that can be utilized to calculate the geographic center of any region. As it has been discussed in here and maybe some other questions.
There is also a nice post by Christopher Wolfram which discusses some issues on calculating the centroid of a large geographical region. I have used the ideas in there to calculate the geographical center of all lands on Earth. The result perfectly matched with this post on GIS SE. The main function was this:
geoRegion3D[meshI : (_MeshRegion | _BoundaryMeshRegion)] :=
Block[{mesh = Quiet@TriangulateMesh@DiscretizeRegion@meshI},
If[Head[mesh] =!= MeshRegion, Missing[], MeshRegion[GeoPositionXYZ[
GeoPosition[Reverse/@ MeshCoordinates[mesh]]][[1]], MeshCells[mesh, 2]]]]
which divides the region into some 3D mesh and then, for example:
r = DiscretizeGraphics[Polygon /@ Map[Reverse,
Entity["Country", "France"]["Polygon"][[1, 1]], {2}]];
GeoPosition@GeoPositionXYZ@RegionCentroid@geoRegion3D@r
calculates the centroid of France. It suffices to replace the polygon of France with the world's polygon, which would take a looong time for calculation.
Now a different question popped into my mind which I wasn't able to find any ideas about. So after an hour of fruitless googling, I decided to try my luck in here.
There is a longitude on Earth which cuts all the land in half. i.e. there would be equal amounts of land on both hemispheres. Can we find this longitude using Mathematica?