Skip to content
Contours vector tiles generation thanks to OpenMapTiles toolchain
PLpgSQL Shell Makefile Python SQLPL
Branch: contours
Clone or download
#1 Compare This branch is 8 commits ahead, 135 commits behind openmaptiles:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


OpenContourMapTiles is a small fork of to generate in one command line elevation contours vector tiles thanks to phyghtmap tool.

Read the OpenMapTiles doc to get used about their toolchain, how to install, use it etc.


To create contours tiles you need Docker.

I work with OSX, I have no issues with it. Linux user will also feel good.

If you are here you already know git and have cloned this repo!


You'll need to register to in order to allow phyghtmap to download elevation data. It's free.

Once you have your user and login, create a file named .earthexplorerCredentials in the root directory of the repo with the content:



Build the tileset in one command line

First you can edit the .env file to change the zoom levels that will be created. 0-14 is the max.

Then use the quickstart script helper

./ france

This will generate a new elevation mbtiles set of all France area... Quite long!

Try first with a small area.


You'll end up if everything works with a file tiles.mbtiles in data directory.

This file contains all vectors tiles with contour layer over your selected area.

Contours lines step is configured to 10m.

Ex: I ran it with "ile-de-france", the area around Paris, France.

Launch a tile server locally to test your data

make start-tileserver

and check at the raw result (click on inspect link on DATA section)

Result: alt text

Ile-de-france build took around 5 min, while French Alps area required around 40 min on my old 2013 iMac.


Once you've got your tiles, you'll need to create a mapbox sytle to serve them from a mapbox tile server.

The content of the tiles is quite simple:

  • Only line strings id "contour"

  • One key "ele" for the elevation in meters

I'll try to create a nice style json to be ready to use.


All code in this repository is under the BSD license and the cartography decisions encoded in the schema and SQL are licensed under CC-BY.

For a browsable electronic map based on OpenMapTiles and OpenStreetMap data, the credit should appear in the corner of the map. For example:

© OpenMapTiles © OpenStreetMap contributors

For printed and static maps a similar attribution should be made in a textual description near the image, in the same fashion as if you cite a photograph.

You can’t perform that action at this time.