1
$\begingroup$

My problem is as follows:

I'm trying to write a program to generate a world map for an RPG that I GM. How should I go about converting spherical geometry to a flat map? Should I subdivide the sphere into hundreds of triangles or hexagons and then build off of that?

Basically, what kind of geometry should I use to map from a sphere to a flat surface in such a way that all original properties except curvature are preserved (including distance and area)?

$\endgroup$
  • 9
    $\begingroup$ Map projections. Long story short, it's not possible to make one flat map which preserves both distances and areas. The Universal Transverse Mercator system gets close, but the price is that instead of one map you have 60. I cannot help but wonder: why do you think that if such a map projection existed it wouldn't be in widespread use? $\endgroup$ – AlexP Apr 15 '18 at 22:33
  • 4
    $\begingroup$ You want to represent the sphere on a plane. This is called a map projection. (Don't let the word "projection" mislead you: most map projections, including the widely known Mercator and plate carrée, are not actually constructed by projecting the points from the sphere onto a plane.) $\endgroup$ – AlexP Apr 15 '18 at 22:43
  • 2
    $\begingroup$ xkcd.com/977 $\endgroup$ – Philipp Apr 15 '18 at 23:01
  • 2
    $\begingroup$ You basically asked to teach you cartography. This is a whole area of study, way too broad and real life issue. $\endgroup$ – Mołot Apr 16 '18 at 6:25
  • 1
    $\begingroup$ If it is a fantasy world, you could take the path of making the planet be a planar solid instead of a sphere. Put some mountain ridges along the edges of an icosahedron to disguise the fold in the landscape. $\endgroup$ – SRM Apr 16 '18 at 11:04
2
$\begingroup$

Icosahedral map

Icosahedron is a polyhedron with 20 triangular faces. Icosahedral maps are often used for RPG. You may easily convert your icosahedron into a sphere. The landmasses won't be too distorded.

Icosahedral pseudoglobe

When you flatten your map, it will look like figure (a) ;

Icosahedral map

You can compare the globe (b) and the icosahedron (c). The distortion is not too big.

If you don't want to have your continents cut in half when you flatten the map, you can move the triangles. The Dymaxion map is a good example of what you can obtain with this method ; The continents shapes and proportions are fairly respected.

Dymaxion map

The biggest inconvenience is that your map may have a weird shape, and you'll have to cut the oceans. But there is no perfect solution. If you want to preserve areas and distances, this is one of the best options.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Marked as answer. I wanted an answer about a specific tile-able technique that works well reliably. This fits perfectly. Thanks for your answer. $\endgroup$ – Drew Christensen Apr 20 '18 at 22:52
4
$\begingroup$

If I understand your question correctly, it's not so much that you want an accurate projection per se; it's that you want to have a character (char) anywhere on a globe looking like he's the centre of his map, and you want to be able to generate an accurate distance measurement between that char and another char.

If that's the case, then AlexP's comment is actually the 'right' answer. The Universal Transverse Mercator projection method is actually how all online maps (Apple, Bing, Google OpenStreetMaps, etc.) work. For them, you want to tile the map anyway; you don't want a phone (for instance) downloading an entire global map everytime they add a new housing development in Bringyabarraback or pave a street in Weardafarkarwee territory. You only want the relevant map tiles to download, and that means map tiles for where you are and where you're going on a just in time basis.

In terms of accuracy, these maps are VERY accurate translations of the sphere because they switch to a new tile whenever you get to within the point of any meaningful error creeping in. So, if you have multiple chars on a 'map', you just put them on the relevant tile, and as they move off it you download the adjacent tile and keep going.

Determining distances is a little more difficult, BUT because your tiles are coherent on the boundaries, you just put up the tiles between point A and point B, measure the straight line distance between the two, AND THE ANGLE, and the measuring the distance is simple trigonometry. This approach is surprisingly accurate and will do what you want it to within reasonable tolerances. (I'm not sure how accurate a distance calculation you need, but the fact that you're talking map projection types means you either need VERY accurate or you've over-cooked the problem, no offense.)

All things considered, as AlexP suggests this is sufficient an approach for pretty much every GPS based navigation system on the planet. I'd seriously suggest you start your search there and if it's not accurate enough, revisit your requirements to figure out why you need better accuracy than that.

| improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.