Fun with Python and Basemap

I recently re-edited my film Ten Tips for Biking Eastern Europe to submit to the Banff Film Festival (yes, a reach, but why not?). I had to alter the film because the old version uses Google Earth to show our bike route, and this is, of course, copyrighted. So I had to make a non-copyrighted map.

To make a new map, I took the KML file of my bike route (which I produced by combining all of the GPS files from the route), and using the Python library matplotlib and the toolkit extension basemap, plotted the route on NASA’s “blue marble” image of the earth, which is an image of the entire earth created by combining cloud-free satellite images. According to my sources, I can use this NASA image as my map background as long as I attribute it. (Note: the image used in the map background below is brought to you by NASA).


Pretty, eh? I wish the blue marble background image were a bit higher resolution, but I think it looks good enough.

This took a long time, not because the coding was difficult (I borrowed code from here and here), but because it took forever to get the Python libraries installed correctly. And, when I did get the libraries installed, the blue marble background image, for some reason, showed up backwards. To right everything, I had to change the “backend” rendering of the matplotlib library by installing WxAgg (As with most Python library challenges, I just followed advice from the Internet until I got it to work).

This entry was posted in Maps. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *