Skip to content

Having some fun with old maps

Friday, 10 September 2010  |  pegon

While relaxing after the hard-working period that was the GSoC, I came across a comment left by Torsten Rahn of the marble team. He wondered whether it would be possible to adapt image warping functionality so that it can be used to morph some old maps.

Apparently, they would like to add historical maps to Marble. Unfortunately, these maps are most of the time not "plate carrée projections" of the globe, which is a requirement for Marble. Hence they use xmorph to convert those maps "by hand" into plate carrée projections.

Of course, it would be too long and too hard for me to do something like xmorph. Though, after taking a look at some of these old maps and searching on wikipedia, I became pretty sure these were some kind of stereographic projections (actually two stereographic projections : each one representing a half of the globe). So, I did the maths and wrote a simple command-line program to convert automatically stereographic projections to plate carrée projections.

I was quite convinced the result would be bad, but actually it turned out quite well :). My program takes a .ppm square image of a semi stereographic projection (rightly centered, etc..) and converts it to a .ppm square image of a semi plate carree projection (the plate carree projection of the corresponding half of the globe).

I tried it with a map that had already been converted by the marble team, in order to see if I obtained the right result. Here is the original map :

And the expected result :

Here is what I gave to my program (the stereographic projection of one half of the globe, cut from the original map, and scale a bit to make it a perfect circle) :

And here is what I obtained (the operation took about 2 seconds) :

Torsten Rahn told me the result looks very similar to what they obtain with xmorph :). They also had distortions appearing on the edges, which needed to be fixed by hand.

For fun, I wanted to try it with a map that hadn't been converted yet :

Here is what I obtained quickly (just the time to cut the two halves of the globe, give them to my program, and merge them properly) :

For those who are interested, here are the sources. It's written in pure C99, and under LGPL.

Now, back to Krita. I was a bit lazy the past few weeks, since I merely fixed 2 or 3 bugs related the transform worker. And now that I am back to school, I will have even less time to work on Krita. Anyway, even if it is at a lower pace, I will still find time to contribute, and maybe even blog ;).