Many countries have collected or are collecting high-resolution terrain data and share it openly. E.g. Austria, and The Netherlands have datasets ready, France is completing a survey until 2026. But as data comes in various formats, projections, licenses, and access schemes, users of open terrain data often rely on proprietary intermediaries such as Google Maps, Esri, or Mapbox.
"Mapterhorn", a project that recently received funding from the European Union, aims to be an open-source alternative with the following components:
1) A global low-resolution terrain tileset based on ESA's Copernicus model.
2) Regional high-resolution terrain tilesets based on national LIDAR models.
3) A data catalog conforming to the open Spatio-temporal Asset Catalog (STAC) specification with coverage information, licenses, and download links for all terrain tilesets.
Terrain tiles are distributed in the Web Mercator projection as Cloud Optimized GeoTIFFs (COG) and PMTiles and are ready for use in MapLibre. There are many use-cases for Mapterhorn's terrain data including disaster response after floods and landslides, planning of solar energy, promotion of tourism, outdoor activity apps, and more.
OpenTopography is an open-data project for digital elevation models. It differs from Mapterhorn in that it has a strong focus on US datasets with almost none from the EU, data is not processed to visualization-ready tilesets, and access to the data often requires a login and is not necessarily free of charge. Mapterhorn will focus on datasets from European countries, but will also be open to data sources e.g. from the US, Japan, Australia, and more.
OpenDEM.info has a great collection of links to open terrain datasets. However, the website only provides processed high-resolution data for a small selection of countries and they do not use modern standards like COG or STAC.
Tilezen Joerd was an open-source project that created a global terrain tileset based on satellite low-resolution and aerial high-resolution data. It is still the most popular source for terrain tiles in the MapLibre community. However, the project is unmaintained and the data is outdated, because Mapzen, the company behind Joerd, went out of business 7 years ago. Mapterhorn is different from Joerd in that it generates regional tilesets for each source. Joerd on the other hand created a global medium to high resolution tileset which meant large areas had to be filled with upsampled data. This made the output huge and difficult to handle, and their approach does not scale to meet today's LIDAR resolution.
Finally, one can find tutorials online that describe how to convert a single terrain source into a tileset. These can be good starting points, but they do not explain how to handle edge merging and the tutorials are often specific to a given input dataset. From their nature as tutorials, they also do not offer any final data downloads which means that people generate or try to generate terrain tilesets over and over again instead of downloading a finished and tested product.
Mapterhorn will start by building infrastructure for viewing and downloading terrain data. For this we will use an existing low-resolution tileset with a maximum zoom of 12.
Next we will create a pipeline for aggregating multiple source datasets. This can be broken up into the following steps:
1) Find and download source datasets and archive them locally in a STAC Catalog. The archiving should include the full source data license.
2) Reproject to pseudo-mercator since we target interactive web map visualizations. The reprojection will be tiled to what we call "macrotiles". These are tiles with the spatial extent of z12 web-mercator tiles which are roughly 10 km wide. Macrotiles can have a resolution of 256x256 pixels, 512x512 pixels, 1024x1024 pixels, u.s.w. depending on the resolution of the source dataset. For example for ESA's Copernicus 30 m model we can use 256x256 pixels, for Switzerland's swissALTI3D 0.5 m model we will need to go to 16384x16384 pixels per macrotile. High-resolution macrotiles are expected to have a size on the order of one Gigabyte.
3) Aggregate macrotiles into a global terrain dataset using the best available sources. We will rank the source datasets and then decide for each macrotile what the target resolution will be. Consider for example Switzerland and Italy. In Switzerland we will use a resolution 16384x16384 pixels, but in Italy a lower resolution of maybe 2048x2048 pixels is sufficient. Macrotiles that happen to cover both Switzerland and Italy will use the higher resolution and the Italian data will be upsampled. At the boundary between the two datasets, elevation values will most likely not be identical. To avoid edge artifacts we will perform edge blending and experiment with different blending approaches.
After the aggregation we have basically the main data product ready. It is a set of macrotiles with variable resolution which depends on the best available data at a given location. We will publish this for download as cloud-optimized geotiffs and make it discoverable with a STAC Catalog.
Much of the above is achievable with existing tools such as GDAL and Python image processing libraries. But Mapterhorn also plans to make some ecosystem improvements such that the terrain data can be easily used by developers.
First, we plan to create a tool to generate terrain PMTiles from the aggregated macrotiles. Brandon Liu has recently published a rio pmtiles tool and maybe we can build on top of this.
Second, we would like to improve support for sparse terrain tilesets in MapLibre GL JS and Native. Sparse here means that the tileset does not have a constant maximum zoom level. To come back to our previous example, one could use a maxzoom of 15 in Italy and 18 in Switzerland in the same PMTiles file. Maybe the addProtocol method could be used for client-side overzoom when high-zoom data is not available. Or maybe MapLibre's handling of HTTP status codes could be improved.
Finally, Mike Barry has created a client-side contour line plugin that uses terrain tiles as input and outputs contour lines as vector geometries. Efforts have started to integrate this into MapLibre's core functionality and we would like to finalize this and bring contour lines into the MapLibre Style Specification with implementations in GL JS and Native.
The timeline for the above is 2025 with work starting in the coming weeks.
Besides the software engineering tasks Mapterhorn faces two main challenges: compute and storage. The EU grant will focus on 5 to-be-defined countries, but to make Mapterhorn truly useful, we will need to expand and process all of the available public terrain datasets. This will require a lot of CPU hours but fortunately should be well parallelizable thanks to the macrotile architecture. And the final data product will be large. Switzerland's data alone will be on the order of 1 TB and the globally aggregated data might well exceed 100 TB at some point in the future.
Maperhorn is an open-source and open-data project and we want to make all downloads free of charge. But processing and hosting this amount of data will incur some costs. If you know anyone who would be interested in contributing some CPU hours or offer some Gigabytes of storage please let us know. A network of mirrors similar to what OpenStreetMap has built could be a good model for Mapterhorn. One could also think of partial mirrors which have country or area-specific data extracts.
The next months will bring a lot of interesting engineering problems. They will range from data processing to client-side visualization libraries and should be quite fun to work on. Building a community of users will be just as crucial as the technical aspects and gathering feedback and incorporating it early on should be our goal. If you have any insights or ideas please get in touch!