Introducing the Elastic projections

15 min read Original article ↗

It’s the end of the Gregorian year, a time to reflect on New Year’s resolutions. My resolution was to finish the fantasy map generator I’m working on. Instead I accidentally made three new map projections.

It’s well known that every world map is inaccurate, to one degree or another. The amount of distortion it introduces to the geographic features on it depends on the specific map projection used. Hundreds of map projections have been invented over the last two thousand years, but many commentators, including myself, remain dissatisfied with the current selection.

It was this that drove me to create the Elastic projections: the most accurate world maps of all time!* By using an arbitrarily large table of numbers to define each projection rather than simple mathematical formulas, the Elastic projections are able to control their distortion with precision hitherto unseen, yielding organic shapes that bend around the coastlines to highlight – and sometimes even magnify – the parts of the map deemed most important. They are a new and improved version of the Danseiji projections I wrote of four years ago. While the core concepts involved are all the same as what I had then, these new projections solve several outstanding issues I had with the Danseiji projections.

I’ll start by walking you through each Elastic projection, what its goals are, and how well it achieves them. Then I’ll talk about how to use these projections, or how to create new ones like them if you’re interested. After that, I’ll explain how they’re different from the Danseiji projections, and then I’ll wrap up. So without further delay, let’s look at the new maps!

The Elastic I projection

The Elastic I projection: accurate landmasses

The Elastic I projection shows the landmasses of the world contiguously and as accurately as possible, without regard for practicality. The oceans are sliced open and distorted in order to preserve the sizes and shapes of the continents.

It’s suitable for maps where the reader isn’t expected to locate specific countries or coordinates, where geographic relations across oceans are not important, and where an artistic flair is desired. The unconventional layout may confuse some readers and make it more difficult for them to understand what’s what, but that confusion may be an advantage if you want to make people stop and think.

Tissot’s ellipses of distortion
Terrestrial ecoregions
Early human migration

Its layout is similar to that of Fuller’s Dymaxion projection or the Danseiji IV projection, but the Elastic I projection uses less interruption than either. As a result, it has a prettier footprint and takes up less space for a given scale.

The Elastic II projection

The Elastic II projection: accurate oceans

The Elastic II projection is the equivalent of the Elastic I projection, but for oceans instead of continents. The continents are sliced up along drainage basin divides, meaning that every river is kept contiguous and adjacent to the sea it empties into. Unlike continents, the oceans of the world are all connected, so some of the straits between them must unfortunately be cut to lay them all out flat. Specificly, the Bering Strait, varius straits in the Malay Archipelago, and the Timor Sea are split by interruptions.

This projection is suitable for maps where the topic is oceanographic or hydrological, but not strongly correlated with latitude (in which case a pseudocylindrical projection centered on the Pacific would be better). It is even more unconventional and difficult to interpret than the Elastic I projection, but the beauty that comes with that unconventionality is its core strength.

Tissot’s ellipses of distortion
Ocean depth and rivers
Chlorophyll concentration

Several ocean-centered map projections have been published before – most notably the Spilhaus world-in-a-square projection, but also variants of Goode’s Homolosine projection and Fuller’s Dymaxion projection. The Homolosine and Dymaxion projections are not really built for this purpose and both cut into the ocean as a result. The Spilhaus projection, sometimes described as “the world according to fish”, succeeds in making them contiguous except at the Bering Strait, with not too much distortion. However, the East China Sea and the southwestern Pacific Ocean are noticeably inflated. Also, it is difficult to include rivers on a Spilhaus map, as many pass over the boundaries of the map or near the extremely distorted continental interiors (fish do also live in rivers, just saying). Thus, while the Spilhaus was a wonderful oceanographic map projection for its time, I view the Elastic II projection as a straightforward improvement.

The Elastic III projection

The Elastic III projection: continents at a larger scale

Finally, the Elastic III projection shows the landmasses in a more conventional north-up arrangement, but with the oceans both heavily distorted and highly compressed. The result is that the continents can be shown at a larger scale on a map that takes up as little space as possible.

This projection is suitable for maps where the only features of interest are over land, and where the reader may be expected to locate specific countries. This includes the majority of world maps published on the internet. This projection is especially suitable for maps with fine details, as the increased continent scale makes them easier to read. It should not be used when there is anything of interest in the ocean, as oceanic features are heavily distorted, and it should not be used in conjunction with geographic coordinates, as the graticule of this map is wildly irregular.

The one thing that bothers me about this projection is the fact that eastern Polynesia is almost completely west-up. This may make it difficult to identify island nations without labels. However, I think the vast majority of people are unable to identify nations in Polynesia without labels anyway, so probably not much is lost there.

Tissot’s ellipses of distortion
Political borders
Driving direction

I’m not aware of any projections that have tried to optimize for continental scale before, other than the Danseiji V projection, which this is the successor of. The main issue with the Danseiji V projection is that it shrinks all ocean regardless of whether doing so actually saves any space. The result is that a lot of islands get shrunk by the ocean around them. The Elastic III projection, by contrast, only compresses ocean as is necessary to fit the map into a smaller rectangle, and takes pains to preserve island groups as well as continents.

How to use the Elastic projections

While there are still many situations that favor a more conventional map projection (regional maps, star maps, maps with both land and sea features, maps of data that’s correlated with latitude or longitude), I believe that the Elastic projections fill several niches much more effectively than any existing map projections. If you agree, then it’s my great hope that you make your own maps using the Elastic projections. The easiest way to do so is to use the SVG templates I’ve made, available in this Google Drive folder (I’ll maybe find a more suitable filesharing means later…). There are blank maps with just coastlines, blank maps with national borders, and blank maps with some subnational borders. All are released to the public domain via the CC0 waiver so feel free to use them for anything without attribution.

If you want to project your own data, you can do so using my Map Designer program. It allows you to easily convert equirectangular maps to a wide variety of map projections – Dymaxion, Cahill-Keyes, AuthaGraph (sort of), and many others. There’s a Raster version for bitmap images and a Vector version for SVGs. You’ll find the Elastic projections in the “Invented by Justin” subcategory.

If you want to implement the projections yourself, you’ll need the tables that define them and some code to read and apply them. You can find the tables in my Elastic projections repository on GitHub. They are available in two formats: text and HDF 5; and in four languages: English, Spanish, Japanese, and Pandunia (the tables themselves are language-neutral, of course; it’s just the annotations that are translated). The HDF 5 files can be opened with HDFView and read programmaticly using a variety of libraries in a variety of programming languages. The text files can be opened with any text editor and read programmaticly natively in any programming language. The HDF 5 files contain more explanatory information, so I recommend using those over the text files if you can.

There are detailed instructions for how to use these tables in the GitHub repository, but to summarize: in both formats, the projection is represented as two or three sections, each of which has a boundary polygon on the globe and a table of the x- and y-values that correspond to certain latitudes and longitudes. To project a point from the globe to the plane, simply find out which section it’s in by finding out which boundary polygon contains it, then find its corresponding point on the map by interpolating on the table. There’s also a table of the latitudes and longitudes that correspond to certain x- and y-values, for projecting a point from the plane to the globe. Interpolate on it to get an approximate solution, and if you need more precision then use that as the initial guess for an iterative solver. For an example implementation, you can see either the example script in the GitHub repository (using Python and the HDF 5 files) or the Elastic projection class in Map Designer (using Java and the text files).

Cuts between sections in the Elastic II projection

Finally, if you’re really into it, you can create your own Elastic projections! As far as I know, I’m the only person who has worked on purely interpolated map projections like these, but the concept is general enough that I wouldn’t be surprised to see more in this space in the future. I’m sure there are tons of variations and innovations yet to be seen.

Areal weights for the Elastic III projection

If you want to build off of my source code, you can find and fork it in my Elastic projections GitHub repository. I won’t explain the process in depth, since there’s a thorough (though slightly outdated) explanation in my published paper. But to cover the main ideas: each projection is created by defining the cuts between the sections, deciding whether land or sea should be weighted more strongly, then optimizing the values in the table to minimize the total distortion, defined as the following cost function:

Here, a and b are the minimum and maximum length scales at each point (that is, the principal strains plus one), ф is latitude, λ is longitude, and wangles and warea are the weights.

Optimization of the Elastic I projection

The cuts are either set manually (as for Elastic I and Elastic III) or based on drainage divides (as for Elastic II). The weights are 1 over open ocean, 100 over land, and between 1 and 100 for the parts of the ocean near land (or the reverse for Elastic II). For the Elastic III projection, large uninhabited landmasses like the Antarctic, the Sahara Desert, and Canada are marked 100 when weighting angular distortion but 1 when weighting areal distortion, so that the optimizer is encouraged to shrink them while preserving their shape. The optimization algorithm used is a second-order gradient descent scheme with a variable step-size. A maximum map size can also be specified, in which case it will be optimized under the constraint that the map must fit within the given rectangle. All of these options are set with the options files in the resources folder of the GitHub repository.

Feel free to reach out if you actually want to use the code and need help!

Comparison to Danseiji projections

As I said earlier, there were a few outstanding problems with the Danseiji projections that I aimed to fix here. I’ll go through those now, in order to detail my design process. The first problem was that the interruption placement algorithm was not very good. It often added unnecessary nubs to the map outline, and wasn’t precise enough to thread interruptions through straits or along isthmuses. To correct this, I’ve set these new projections’ interruptions manually. I also introduced the idea of multiple sections so that interruptions no longer need to be along mesh edges. Since the interruption resolution is no longer tied to the mesh resolution, I can have coarser meshes for the Elastic projections than I did for the Danseiji projections, greatly reducing the data files sizes.

Next was the fact that the Danseiji projections were difficult to implement. The triangular mesh made the forward-projections quite involved, and the inverse-projections nearly impossible. With the new interruption implementation, though, I can switch to a rectangular mesh. Now you can use off-the-shelf grid interpolation algorithms like SciPy’s RegularGridInterpolator for the forward-projection. The fact that each section is more or less continuous also makes the inverse projection much easier (still not easy, but at least doable).

In addition to all that, the Danseiji projections’ data files were only available in a homebrewed text format. It worked fine, but I expect it was a bit of a pain for people to read programmaticly. Luckily, I have since learned of our Lord and Savior, Hierarchical Data Format. HDF files are designed to store arbitrarily structured data in a way that’s easy to read and intuitive to interpret. Not only are relationships between the different tables apparent from the hierarchical structure, but their meanings and units can be easily added as text attributes. I expect some people will still find the text files easier, so I provide those as well, but even if this is the first you’re hearing of HDF I strongly encourage you to give it a try.

In addition to both data file formats, I’ve also elected this time to generate political map templates, since that puts the barrier of entry way way lower than any data file format.

You may notice that I only made three Elastic projections, whereas there were a whopping seven Danseiji projections. That’s because when I made the Danseiji projections, it was partially to map out the thitherto unexplored parameter space of mesh-based map projections, so I wanted to highlight every possible use case. With the Elastic projections, my goals were more focused.

With hindsight, I know that lenticular mesh-based projections (Danseiji N, I, and II) aren’t that good or interesting, and don’t gain you much you don’t already get from the Eckert or Györffy projections. Similarly, I know that cartograms using this elasticity method (Danseiji VI) are not nearly as accurate as existing cartogram algorithms like Gaster–Newman or manual mosaics. Finally, I’ve come to the conclusion since four years ago that there aren’t many use-cases for Danseiji III that aren’t better served by Danseiji V. Danseiji III was supposed to be for when you didn’t care about the oceans being distorted but didn’t want them to be distorted too much. Realisticly, you’ll either care about the oceans (so use Robinson) or you won’t (so use Danseiji V).

Thus, I only felt it was necessary to adapt Danseiji IV and V to the new techniques. They became Elastic I and Elastic III, respectively, while Elastic II came from what was going to be Danseiji VII but never really worked. In my opinion the result supersedes the Danseiji projections for all reasonable use-cases, so Danseiji is more or less obsolete.

But perhaps the most important difference between the Elastic projections and the Danseiji projections is the name. ”Danseiji” is too weeby. By instead using a single pre-existing English word that’s also used in many other languages, I hope to make it easier to understand what the Elastic projections are about just from their name. I still don’t really understand why people were interpreting “danseiji” as “when male”, but that’s much less likely to happen now!

Conclusion

And that’s all you need to know about the Elastic projections! I hope you think they’re as cool as I do. To me, the Danseiji projections were really just a proof of principle, whereas the Elastic projections are more of a full-fledged implementation of the same ideas. Who knows, maybe in four years I’ll come up with something better and claim that the Elastic projections were just a proof of principle. But I don’t think that’s terribly likely.

When I published my Danseiji paper, I felt that I could take this concept further, but I wanted to work on other things. Publishing this, on the other hand, I actually feel done. I kind of feel like these are the perfect map projections. Of course such broad statements are extremely subjective and can’t be true for all use-cases. But the Elastic projections are everything I personally have ever wanted in a map projection, and it feels satisfying to achieve that.

Anyway, I need to take a break from map projections now. Time to get back to that fantasy map generator!

Edit April 2024: I added details about the cost function, as well as a short outline to the introduction.

Edit November 2024: I now know of two others who have created similar mesh-based map projections! Check out Martin Loncaric’s Martin 1, 2, and 3 projections, and Robert Sargent’s Liquid Earth projection.