Tangram Heightmapper

Mapzen recently released a whole lot of high-quality open-source terrain data in the form of a pair of global tilesets, using raster images to store the elevation and slope of the surface of the earth.

I’ve previously described some ways to render this data in a 2D context, but it can also be used to generate 3D models, like this one of Mt. Diablo in California:

3d print of Mt. Diablo

I made a viewer called Heightmapper to browse the terrain tiles and create heightmaps from them, which are grayscale images of terrain data.

Here’s the above view in the Heightmapper, roughly (the printed model is south-side-up):

mount diablo heightmap ( Open full screen ➹ )

A heightmap like this one can be turned into a 3D model by using it as a “displacement map”, which displaces the vertices of a 3D mesh according to the brightness of each pixel, like this:

displacement map

By default, Heightmapper is in “auto-exposure” mode, to ensure that the current view’s elevation values are spread out over every gray in the grayscale. This mode checks the highest and lowest values in the current view, and sets the levels to make use of the full tonal range.

To aid in scaling the resulting models, a “scale factor” in Heightmapper’s control panel shows the vertical range of the current view, expressed as a ratio in terms of the view’s width. When you export, use this factor to determine how tall your model should be on the z-axis. (I made a brief tutorial for doing this in Blender, a popular but confusing open-source 3D application.)

Blame it on Terrain

This view also reveals surface details which aren’t easily visible even in a 3D model. By turning up the contrast on the data, it provides glimpses into the deep history of the landscape, hidden in small differences in the terrain. For example:

The prehistoric coastlines of the Great Lakes:

great lakes heightmap ( Open full screen ➹ )

The folded mountains which give shape to the Three Gorges:

three gorges heightmap ( Open full screen ➹ )

The fractal boundary between watersheds in central India:

india watersheds heightmap ( Open full screen ➹ )

The overlapping former paths of the Mississippi, now bounded by levees:

mississippi heightmap ( Open full screen ➹ )

Check out the Heightmapper code or fork it at the github repo.