Carl Cervone

Topographic Colormaps

September 13, 2021

This post is also available on Medium.

Working with custom color palettes and digital elevation models to render beautiful topographic prints in Python

Nine prints from the Topoloco Project

I’ve always enjoyed playing with maps.

As a kid, I would pore over the ski mountain maps of James Niehues, memorizing the trail names and verticals. His maps inspired me to hand-draw my own (fictional) ski resort maps.

For my senior project in high school, I programmed a ski resort simulation. It was basically Rollercoaster Tycoon for ski resorts. It allowed the user (me) to cut trails, install lifts, and view summary statistics for a randomly generated mountain.

This project brought me back to those early days of map making. However, instead of trying to create a realistic rendition of a fictional landscape, this project renders an actual topography with a unique color palette.

The project uses the Python elevation library to pull images from the NASA Shuttle Radar Topography Mission Global 1 arc second number (SRTM 30m) data catalog. Then, a script ingests the image, arranges the elevation data, and renders them with a contour plot.

An unfilled contour map of Yosemite National Park

Next, the script maps the elevation values to a color palette. Each image has its own custom linear segmented colormap (LSC), comprised of two complementary colors from Tobias van Schneider’s wonderful colors catalog. I’m still experimenting with randomly choosing the color bases as well as algorithms for selecting complementary colors.

The footer at the bottom of each image shows the colormap and the distribution of elevations contained in the image (in meters).

The colormap and elevation distribution

I’ve also created a version that turns a sequence of plots into an animated gif.

Gif version of the Yosemite topographic map

I especially enjoy the gif renderings of craters and volcanos. Here’s a reversed gif of the Nyiragongo volcano in the Democratic Republic of Congo, which erupted earlier this year and is on my bucket list of volcanos to climb.

Nyiragongo — an active volcano in the DR Congo

Mauna Kea, the highest point in Hawaii, is less symmetric and more gently sloped — and less foreboding in real life too.

Mauna Kea — a 4000+ meter shield volcano

Here’s the Great Rift Valley, around the same region in Ethiopia as this beautiful map made by John Nelson,

A portion of the Great Rift Valley in Ethiopia

I lived in Ethiopia for five years. My favorite topography there, at least from the ground perspective, is the Semien Mountains, in the northwest of the country. (These photos are incredible.) It was hard to get a good contrast in the image because the elevation distribution is bimodal; it might be a good candidate for a more complex colormap assignment.

The Semien Mountains in Ethiopia

I’ve created an Instagram account @topoloco_art for these images. Follow along if you like them and DM me if you have any places or palettes you want to try out!