What are the options for rendering tm2 projects?

As far as I know the open source Mapbox tm2 projects have proprietary data sources (like OSM Bright 2), thus they are of little use, but some other projects have available sources, for example:

How is it possible to make a PNG rendering tile server which uses one of these styles as input source?

Are these even compatible with each other, or they prefer to be within their own pipeline?

Do I understand right that it has to be a 2 pass rendering:

  1. For creating the Mapnik vector tiles in PBF format (using the PostGIS backend)
  2. For taking the PBF tile file + styling information and rendering a PNG out of it

I see that there are some solutions which solve one part. For example:

  • Kosmtik can rasterize
  • Avecado can create PBF files, but the server part is only for testing
  • Kartotherian can kind of do everything but uses dozens of outside modules. On the other hand it is really well documented and it might be the only out-of-the-box solution so far
  • Mapzen's vector datasource can create and serve PBF files
  • Mapzen's TileStache fork looks like a serious fork but is without documentation or mentioning what it is capable of
  • The Mapbox stack is kind of open sourced, but without documentation so it's really hard for anyone to figure out how to use it (as mentioned by Andy Allan in his presentation below)
  • Andy Allan presented Vtiler + Hailstorm + Weatherman but I couldn't find anything about them
  • The tessera server seems interesting and can serve from tm2 styles, but it's not clear how can I make it pre-render and cache PBF files.

Can someone explain how to make the simplest possible PostGIS -> PBF -> PNG rendering pipeline?

Wouldn't it be a simple 2 pass rendering with mapnik-vector-tile?


Preparing the vector PBF tiles is the first step.

The MapBox Studio Classic is able to generate for you the vector PBF tiles (packed in MBTiles format) from any vector source (ShapeFiles, PostGIS, ...) and is quite easy to use. Under the hood it does the rendering with the mapnik+mapnik-vector-tile as you mentioned wrapped in tilelive (so scripting is possible too).

I have prepared a simple project for basic vector tiles example, to demonstrate the process: https://github.com/klokantech/vector-tiles-sample and wrote some tips in readme.md there. The sample vector PBF tiles can be downloaded as countries.mbtiles.

Once you have the vector tiles, you can host them directly on the web and display with a WebGL viewer in a web browser. Hosting is easy with the TileServer project, but can be done even without extra server software. See: http://klokantech.github.io/mapbox-gl-js-offline-example/ using the MapBox GL JS WebGL viewer and custom style - source codes at https://github.com/klokantech/mapbox-gl-js-offline-example

The same vector tiles can be rasterised into PNG tiles with a server-side process - for older non-WebGL viewers. This is quite easy to do with the tessara project (which has under the hood again mapnik). Check http://osm2vectortiles.org/docs/ and tileserver-mapnik tutorials for a step-by-step guide for how to use a .tm2 and .tm2source to serve raster PNG tiles.

Not the answer you're looking for? Browse other questions tagged or ask your own question.