Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenMapTiles Beginner questions

Tags:

openmaptiles

I'm looking to replace Google Maps by something self-hosted and free. After searching for some time I found OpenMapTiles. I'm very new to this stuff, so there are many things I don't understand, namely:

  • I'm not sure I qualify for pre-rendered tiles, can I generate my tiles myself from osm data?
  • I would like to have something like google terrain map, with contour lines, is that possible with OpenMapTiles?
  • I also have some GPS tracks that I would like to show like overlay over base maps (OSM or Google), and I want them clickable (clicking open a link or popup or something like that), is that possible?
  • Is OpenMapTiles server heavy to run?

Thanks

like image 945
st. Avatar asked Sep 16 '25 15:09

st.


1 Answers

That's totally possible, I've done it myself. However, it takes a while to do everything.

1. Generate MBTiles

First of all, I'd suggest you start taking a look in the Github repo of OpenMapTiles: https://github.com/openmaptiles/openmaptiles

To generate an MBTiles file, for a country is quite manageable to do in your own computer. And basically you can do so by executing the main script with the name of the country as a parameter. Like this:

./quickstart.sh portugal

After the script creates a Docker machine, downloads the OpenStreetMap data for the country, processes it, and generates the MBTiles file, then you'll be done.

For me, with an average computer, for countries like Spain or Portugal, it takes about 4-12 hours to do so. But it really depends on the country. Norway takes forever (about 4 days), I believe due to its very long coastline.

If you want an MBTiles file that will work for the whole planet, then you need a more powerful computer, that specially has a big SSD and lots of RAM. Between 32 and 64 GB of RAM and 250-300 GB of SSD.

2. Set up a tile server

After that, you can use this project https://github.com/urbica/tessella to run your own tile server to be consumed form a website or mobile app.

The resources of the server will depend on the size of the MBTiles file you want to use in the server.

3. Enable contour lines

This is possible too, but a bit more trickier. I'd suggest you use Maptiler as a service for this.

Whenever I achieve this matter, I'll go back to you with the information.

If the tiles you generate don't contain the contour / elevation data, then styles won't help. The tiles from OpenMapTiles do not have the contours inside.

4. Web and mobile libraries (to display GPS tracks, waypoints, etc)

This is possible as well. What technology you want to use here?

For web apps:

  • There's a well established library, Leaflet: https://leafletjs.com
  • More recently, looks like MapLibre is taking the lead (fork from Mapbox GL JS): https://github.com/maplibre/maplibre-gl-js

For mobile apps:

  • VTM is an open source iOS and Android library: https://github.com/mapsforge/vtm
  • There's Carto, which is more recent but it has a great support: https://github.com/CartoDB/mobile-sdk
  • And MapLibre has a native Android and iOS library too: https://github.com/maplibre/maplibre-gl-native
like image 114
xarlymg89 Avatar answered Sep 18 '25 08:09

xarlymg89