Greg Hewgill (ghewgill) wrote,
Greg Hewgill

open source wednesday: xearth

Years ago, I ported the classic Unix program "xearth" to Windows. Xearth displays an image of the Earth, as seen from your favorite vantage point in space, correctly shaded for the current position of the Sun. At the time, xearth had its own homepage and was updated every few years by the original author (Kirk Johnson). But a few years ago, I noticed that the original xearth home page had vanished from the internet. I was able to piece it back together using

I have resurrected the original xearth page at Currently this is the original (non-Windows) xearth page but I intend to pick up development of xearth going forward. I have created a Github repository containing all the past versions of xearth that I could find, plus my new developments.

One of the things that I've always wanted to add to xearth is the ability to "wrap" an arbitrary image around the Earth. There are loads of images suitable for projection onto a sphere, images of the Earth of all kinds. Here is the original xearth green-and-blue image (click for a larger view):

I finally (a decade later) got around to working out all the spherical trigonometry necessary to project images onto the xearth image. Here's a sample of what xearth can do now:

The maps don't even have to accurately reflect reality. Here is one from a 1678 world map:

Before I could do this with xearth, I also had to add the ability to create JPEG images (I added PNG while I was at it), and refactor some of the internal code to deal with true colour images instead of just palette-based images.

The code to do this is in the xearth repository on Github now. It's not ready for release yet, but feel free to fork and play with it.

  • new zealand government goes creative commons

    This looks like a fantastic step forward: New Zealand Government Open Access and Licensing Framework The draft NZGOAL sets out a series of policy…

  • earthquake

    About an hour ago, we felt a magnitude 5.4 earthquake. Although New Zealand is a fairly seismically active area, we had not felt an earthquake since…

  • kiwi english

    After being here for a couple of months, I've started to notice all sorts of ways in which Kiwi english is different from North American english.…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded