Protomaps Blog

Mapterhorn - Terrain for Web Mapping

The Protomaps project is the PMTiles format, its tooling, and a 120GB basemap vector cartographic tileset created from OpenStreetMap and other open data sources. PMTiles is not limited to storing vector data - it’s also used for raster data, like scans of historical paper maps.

Mapping apps often don’t just need to show vectors of buildings, boundaries and places. Some apps need elevation data, since interesting places on Earth aren’t flat! The Mapterhorn project fulfills this with a new independent open data product - it’s Protomaps for Terrain.

Project Inspiration

Mapterhorn’s inspiration is the Mapzen Joerd project. Joerd is available as tiles from AWS Open Data, and was originally created for the Tangram map renderer, but works with MapLibre GL as well. It’s built from a collection of digital elevation models (DEMs) processed into a single tileset using batch jobs on Amazon Web Services.

{
  type: 'raster-dem',
  tiles: ["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],
  maxzoom: 13,
  encoding: 'terrarium',
  attribution: "<a href='https://github.com/tilezen/joerd/tree/master'>Joerd</a>"
}

Mapterhorn’s goals are similar to Joerd - create a global, easy-to-use terrain tileset, with an initial focus on European DEMs.

Key project differences

Mapterhorn’s design differs from Joerd and other open data projects in these ways:

  • Focus on interactive web visualization - The end product is sliced into tiles at conventional sizes like 512x512 pixels for direct usage in 2D and 3D web maps. Tiles are stored in the terrarium encoding which MapLibre GL supports.

  • Ease of tileset recreation - Instead of being tied to AWS, Mapterhorn can be reproduced from scratch using a single powerful machine, either a desktop or a rented server. This means the pipeline can be customized with different data if your project requires more detail in certain countries. The full pipeline is open source on GitHub.

  • Ease of deployment - Mapterhorn distributes the end product as static PMTiles archives, which can be directly read from cloud storage to map libraries in browsers. This is used to visualize the Mapterhorn tileset on mapterhorn.com as well as the pmtiles.io viewer.

Using the PMTiles format for distribution means you can use the pmtiles extract CLI on a planet archive. To extract only the area surrounding the Matterhorn, try this:

pmtiles extract \
  --bbox=7.510659,45.897669,7.799642,46.04662 \
  https://download.mapterhorn.com/planet.pmtiles \
  planet.pmtiles

Project Future

Oliver Wipfli, a former official coordinator of the MapLibre project is leading the development of Mapterhorn. The initial phases of the project are supported by an NLnet grant. If you’re a company or organization that needs high resolution terrain for web visualization, start a discussion on GitHub!