The world’s leading publication for data science, AI, and ML professionals.

The World Map with Many Faces - Map Projections

In this short piece, I review what map projection is and show a series of examples of projecting the World map using Python and Natural…

The Earth is more or less a sphere, certainly a 3D object (despite some challenges even this), while our printed maps and digital screens are 2D. The intermediate step that transforms the sphere into our 2D maps, whether it be a cartographic atlas or a fancy GIS app, is called map projection.

There are numerous ways to map the ellipsoidal surface of the Earth into a flat surface; however, as these are approximative models, there usually are some shortcomings we need to keep in mind. In some projections, relative angles and polygon (e.g., country) shapes are preserved; in others, the real area or specific Euclidean distances are kept constant. These properties also help you pick the best projection for your use case.

As for the types of projections, there are multiple ways, such as cylindrical, conic, azimuthal, and pseudocylindrical projections. A practical method of transforming from one another is to change the coordinate reference systems (CRS), where Python and the libraries PyProj and GeoPandas came in very handy!

According to Mathematics.com, there are six main categories of projection types:

  • Cylindric
  • Pseudocylindric
  • Azimuthal
  • Lenticular
  • Miscellaneous

Here, I will not follow such a strict categorization but rather show you nine map projections that I thought looked interesting. Depending on the specific projection, these steps usually result in distortion of shape, area, distance, or direction, so you should choose carefully when going for a real-life project. For that, this collection of projection systems and my code provided below should help. So, without further ado, the maps:

1. Eckert II Projection Characteristics: The Eckert II projection is an equal-area pseudocylindrical projection. It preserves area accuracy but distorts shapes and distances. Common Use: Moslty used for novelty maps of the world showing a straight-line equal area graticule.

2. Equirectangular Projection Characteristics: The Equirectangular projection is a simple cylindrical projection. It preserves latitude and longitude as straight lines but distorts shapes and areas as you move away from the equator. Common Use: It’s often used for educational or general reference and thematic world maps.

3. Lagrange Projection Characteristics: The Lagrange Projection is conic and conformal. Distortions happen in both areas, shapes and directions.Common Use: According to ChatGPT, its rare use-cases mostly cover oceanography.

4. Larrivée Projection Characteristics: According to this source, undistorted only at the center of the map, while mostly distorted in the form of areal inflation

5. Mollweide Projection Characteristics: The Mollweide projection is an equal-area pseudocylindrical projection. It preserves area but distorts shapes and angles. It has a unique elliptical shape. Common Use: It’s used for global maps when area accuracy is essential, especially in geography and geophysics.

6. Natural Earth Projection Characteristics: The Natural Earth projection is a pseudocylindrical projection designed for world maps. It balances size and shape distortion (but does not conserve either), providing a visually pleasing map. Common Use: It’s popular for world maps and atlases due to its balanced distortion properties.

7. Quartic Authalic Projection Characteristics: The Quartic Authalic projection is a pseudocylindrical projection equal-area projection that preserves areas accurately but distorts shapes, angles, and distances. Common Use: It’s used in cartography for special applications where accurate area representation is crucial.

8. Rectangular Polyconic Projection Characteristics: The Rectangular Polyconic projection is a conic projection that minimizes distortion along a meridian. Sometimes called the War Office projection. Common Use: It was mainly used for US military purposes.

9. Sinusoidal Projection Characteristics: pseudocylindrical equal-area map projection, representing the poles as points, preserving the area, and distorting shapes. Common Use: Mostly advice to use for Mapping areas near the equator.

Finally, as data source for the visualizations, I used the following two data sets from Natural Earth:

Now, let’s see the code:

import geopandas as gpd
import matplotlib.pyplot as plt
import pyproj
world = gpd.read_file('ne_10m_admin_0_countries')
ocean = gpd.read_file('ne_10m_ocean')
# visualize all projections at once
projection_dict = { 'Eckert II': '+proj=eck2 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',
                    'Equirectangular': '+proj=eqc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs',
                    'Lagrange' : '+proj=lagrng',
                    'Larrivee' : '+proj=larr',
                    'Mollweide': '+proj=moll +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',
                    'Natural Earth': '+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',
                    'Quartic Authalic': '+proj=qua_aut +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',
                    'Rectangular Polyconic': '+proj=poly +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',
                    'Sinusoidal' : '+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'
                  }

f, ax = plt.subplots(3,3,figsize=(15,15))
indicies = [(i, j) for i in range(3) for j in range(3)]

for idx, (projection_name, proj4_string) in enumerate(projection_dict.items()):

    bx = ax[indicies[idx]] 
    world_projected = world.to_crs(proj4_string)
    ocean_projected = ocean.to_crs(proj4_string)
    ocean_projected.plot(ax=bx, color = 'lightblue')
    world_projected.plot(ax=bx, cmap='Greens', edgecolor='k', linewidth = 0.25, alpha = 0.9)
    bx.set_title(f'{projection_name} Projection')
    bx.axis('off')  

plt.tight_layout()

Related Articles