The world’s most beautiful places are rarely flat. From the soaring peaks of the Himalaya to the vast chasm of the Grand Canyon, many of the most stunning sites on Earth extend in all three dimensions. This poses a problem for mapmakers, who typically only have two dimensions to work with.

Fortunately, cartographers have some clever techniques for creating the illusion of depth, many of them developed by trial and error in the days before computers. The best examples of this work use a combination of art and science to evoke a sense of standing on a mountain peak or looking out an airplane window.

One of the oldest surviving maps, scratched onto an earthenware plate in Mesopotamia more than 4,000 years ago, depicts mountains as a series of little domes. It’s an effective symbol, still used today in schoolchildren’s drawings and a smartphone emoji, but it’s hardly an accurate representation of terrain. Over the subsequent centuries, mapmakers made mostly subtle improvements, varying the size and shape of their mountains, for example, to indicate that some were bigger than others.

But cartography became much more sophisticated during the Renaissance. Topographic surveys were done for the first time with compasses, measuring chains, and other instruments, resulting in accurate measurements of height. And mapmakers developed new methods for depicting terrain. One method, called hachuring, used lines to indicate the direction and steepness of a slope. You can see a later example of this in the 1807 map below of the Mexican volcano Pico de Orizaba. Cartographers today refer (somewhat dismissively) to mountains depicted this way as “woolly caterpillars."

View Images This detail from an 1807 map depicts the Pico de Orizaba volcano in Mexico. It uses lines to depict slopes, a technique that’s inspired some cartographers to derisively call such mountains “woolly caterpillars.” Photograph by David Rumsey, Map Collection, Stanford University

A more nuanced method of depicting topography is shaded relief, which uses shading to simulate the shadows cast by mountains and other vertical features of the terrain. A beautiful early example of this can be seen in Leonardo da Vinci’s map of Tuscany below.

View Images Leonardo da Vinci drew this map of Tuscany in or around 1502. Photograph by Fine Art Images, Heritage Images, Getty Images

The art of shaded relief reached a pinnacle (so to speak) in Switzerland in the mid-20th century. “The Swiss are historically the masters of terrain representation because they have a lot of it to deal with,” says Daniel Huffman, a cartographer based in Madison, Wisconsin. American cartographers at institutions like the National Park Service and National Geographic often traveled to Switzerland to learn from the Swiss and collaborate with them on projects.

View Images This shaded map of Mount Everest by Swiss cartographer Eduard Imhof shows a combination of shaded relief, color, and faint contour lines to indicate depth. Map by Swiss Secondary School Atlas

The Swiss made several innovations in that era that are still used by cartographers today, says Bernhard Jenny, a cartographer at the Royal Melbourne Institute of Technology in Australia. Many of these were invented by Eduard Imhof, a professor at the Swiss Federal Institute of Technology in Zurich. Imhof literally wrote the book on shaded relief—his Cartographic Relief Presentation, originally published in German in 1965, is still essential reading for cartographers (it was also the main source for the brief history above).

One of Imhof’s greatest contributions, Jenny says, sprang from the realization that when you stand on a mountaintop looking toward the horizon, closer peaks appear sharper than distant peaks due to atmospheric haze. Imhof tried to imitate that effect by giving the viewer an aerial perspective, as if looking down on the terrain as from a satellite or airplane. “The highest peaks are closest to the viewer, so they’re depicted with the highest contrast, while the lowest valleys are farthest away, so they’re depicted with the lowest contrast,” Jenny says.

You can see this approach at work in Imhof’s shaded relief of Graubünden, Switzerland, below.

View Images Eduard Imhof drew this shaded relief of Graubünden, Switzerland, in the Alps, more than 50 years ago. Map from shadedreliefarchive.com

Imhof and his Swiss contemporaries were also masters of illumination. In the image above, the main source of illumination comes from the northwest. If you think about it for a minute, that’s very odd. Switzerland is in the northern hemisphere, which means the sun always appears in the southern sky. But the Swiss cartographers knew that the human brain is easily fooled into confusing ridges and valleys on maps and satellite images unless the illumination comes from the northwest. The reason remains mysterious, but you can see an example of this in the side-by-side images below.

In a study published earlier this year, two researchers based in Switzerland, Julien Biland and Arzu Çöltekin, showed terrain images with differing angles of illumination to 27 volunteers and came up with a remarkably precise estimate of the optimal angle for reducing this optical illusion: 337.5 degrees, just a bit to the north of the 315 degree northwest lighting cartographers have traditionally used.

View Images The red letters A, B, and C sit on top of a ridge in the shaded relief image on the right, which has northwest illumination. They appear to sit in a valley when the illumination comes from the southeast. Map by Julien Biland and Arzu Çöltekin

These days the angle of illumination and other features that affect the perception of depth can be easily tweaked by computer (you can play around for yourself on this online map Jenny developed). Daniel Huffman goes even further, using 3-D modeling software to mimic the way light bounces around a scene. “Real-life lighting involves light bouncing off one surface onto another.” Capturing that play of light can make a terrain map look more realistic, he says.

But in the days before computers, cartographers often went to great lengths to get the illumination right. One labor-intensive method invented in the 1920s, the so-called Wenschow technique, involved carving a plaster terrain model then photographing it. It never really caught on, Jenny says, in part because sticking to a single angle of illumination often doesn’t yield the best results. In Imhof’s Graubünden map above, for example, the short ridge extending down from the top left corner of the image would be equally illuminated on both sides by northwest light, making it look flatter than it really is. To sidestep that problem, Imhof shifted the illumination for just that one part of the terrain around to the west, casting a shadow on the east side of the ridge that helps it pop out more.

View Images National Park Service cartographer Bill von Allmen drew the shaded relief of Glen Canyon (right) using erasable blue contour lines from a topographic map (shown in detail in the image on the left). Map by Bill von Allmen, National Park Service

Making shaded relief maps in the pre-computer days was incredibly laborious, says Tom Patterson, a senior cartographer with the National Park Service. A single map might take a month or more to make. One of Patterson’s predecessors at the park service, Bill von Allmen, developed a technique for temporarily transferring the contour lines—the lines that connect points of equal elevation—from a topographic map onto a blank sheet of paper. Then, using the contour lines as a guide, von Allmen would spend weeks using an airbrush to shade the hillsides with a fine mist of ink. When he was finally satisfied with the shading, he’d treat the paper with a chemical that made the lines disappear, leaving only his relief shading behind.

For more than a century, cartographers have tried using color to indicate elevation on maps. In the mid-1800s, Austrian cartographers made vibrantly colored maps of the Alps and other mountainous regions of Europe like the one below. But they were hard to read because the wild color schemes weren’t intuitive, Jenny says. A gradual color scheme that progresses from dark to light, like the one in Tom Patterson’s map of Glacier National Park (just beneath the Austrian map), tends to work better, especially if the colors also jibe with the terrain (blue lakes and white glaciers make sense to most people, whereas the psychedelic mountains of the 19th-century Austrians require more effort to understand).

View Images Austrian cartographer August Papen made this colorful map in the late 1850s. It makes a striking impression, but it’s hard to correlate the colors with elevations without careful study of the legend. Map courtesy Cartographica Helvectica

View Images This detail from Tom Patterson’s map of Glacier National Park includes the scenic Going to the Sun Road. Map by Tom Patterson, National Park Service