Map Projections using Python & Basemap

The numerous external libraries available for Python continue impressing me, in scope, numbers and ease of use.  A couple of hours ago I googled for chartographic tools for Python, and found the Basemap-library, an add-on to Matplotlib. For whatever reason, it’s not available for pip install, so I had to install it from sources, which was totally painless. Then, after finding this basemap tutorial, it took just about 15 lines of code and equally long time in minutes to draw the different map projections above, all showing a flight path Stockholm – San Francisco.

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np

lat1,lon1 = 59.6498,17.9238 #arn
lat2,lon2 = 37.6213,-122.3790 #sfo


map = Basemap(


x,y = map(17.9238,59.6498)
x2,y2 = map(-122.3790,37.6213)
plt.title(‘van der Grinten Projection’)

About swdevperestroika

High tech industry veteran, avid hacker reluctantly transformed to mgmt consultant.
This entry was posted in development, Maritime Technology, Nautical Information Systems and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s