State of Vector Tiles for Self-Hosting in 2024

Hi,

I’m working on a project that requires self-hosting vector tiles derived from OSM data, and I’m looking for up-to-date information on the current state of vector tiles in 2024.

My Project Requirements:

  • I want to self-host vector tiles
  • Tiles should be pre-generated (similar to PBF downloads from Geofabrik)
  • Must be suitable for commercial use
  • Preferably covering specific countries or regions
  • Planning to use MapLibre for rendering
  • Want to support the following tile endpoint style: /tiles/{z}/{x}/{y}.pbf

My Current Setup:

I’m currently using MapLibre with the following configuration:

const map = new maplibregl.Map({
  container: 'map',
  style: {
    version: 8,
    sources: {
      osm: {
        type: 'vector',
        tiles: ['https://tiles.stadiamaps.com/data/openmaptiles/{z}/{x}/{y}.pbf'],
//                                                             ^^^^^^^^^^^^^^^^
      }
    },
    // ... rest of configuration
  }
});

My goal is to replace the tiles URL with a self-hosted solution that follows the same /{z}/{x}/{y}.pbf pattern.

Questions:

  1. Are there any current sources for downloading pre-generated vector tiles that can be self-hosted and used commercially, compatible with the MapLibre setup described above?
  2. What are the most up-to-date tools or pipelines for generating vector tiles from OSM data in 2024 that would work with this configuration?
  3. Are there any recent developments or projects in the OSM ecosystem related to vector tiles that I should be aware of, particularly those compatible with MapLibre?
  4. What are the current best practices for serving vector tiles, especially when self-hosting with the /{z}/{x}/{y}.pbf endpoint style?
  5. Are there any challenges or considerations I should be aware of when working with vector tiles in 2024, specifically in the context of using MapLibre and self-hosting?

OpenMapTiles and Geofabrik’s VectorTiles are services which I prefer not to consume and won’t work for commercial usage. Generating my own tiles seems too difficult for low zoom levels that cover large areas of the world.

Any insights, recommendations, or pointers to recent discussions on this topic would be greatly appreciated. Thank you in advance for your help!

1 Like

Your posting seems to be missing maybe the most important bit of information: tile for which region or do you want global coverage?

But regardless you can either use tilemaker GitHub - systemed/tilemaker: Make OpenStreetMap vector tiles without the stack or planetiler planetiler/PLANET.md at main · onthegomap/planetiler · GitHub to tile OSM data (at least historically tilemaker has been more flexible wrt the tile schema).

3 Likes

If you are willing to use Java, you can also use the planetiler-core library to render arbitrary geodata to vector tiles. It’s more complicated than the lua approach in tilemaker but if you stack happens to already be in Java, it’s a clean integration.

There is also the OSM US tile service if pre-rendered OpenMapTiles-schema planet files would suit your purpose. Of course that won’t work if you truly can’t use OpenMapTiles vice not wanting to pay MapTiler for their OpenMapTiles-based MapTiler Cloud service.

If you are just looking for a map, as Simon notes, there are several options that basically work out of the box with a bit of hardware needed to run it.

I want most western countries, so quite some. That means all of Europe, USA and a few more with an acceptable state of mapped buildings. At the same time I really want to be able to see the whole world when zoomed out. So a little of both depending on the zoom level.

After my post I stumbled on https://protomaps.com. It seems to be the most acceptable solution for now.

I probably will end up using tilemaker. Is there a reason why openstreetmap.org or anybody else is distributing these generated vector tiles in any format in the way that geofabrik does it with their osm.pbf files? Or split into archives of areas in the /{z}/{x}/{y}.pbf format?