[GIS] Custom tile server – how to create a layer using Mapnik and mod_tile using POSTGIS db

mapnikmod-tileopenlayersopenstreetmappostgis

I have created a Ubuntu 14.04 tile server.
I loaded an OSM base map into the POSTGIS database and created a slippy-map using OpenLayers 3.9.
Then I loaded data of an overlay into the POSTGIS database and now I am trying to create a layer for it.

To create layers, the only solution with decent documentation seems to be Tilemill.
But to use Tilemill on my server I have to use "SSH connection forwarding", explained here.
I don't want to create a security leak into my server.

Are there any other options, with decent documentation, with which I can create custom layers for my map?

What I already 'know':

  • Create a simple map with Mapnik

  • Store shape files into the POSTGIS database

  • Use OpenLayers to display the layer

What I need to know:
I have a simple overlay (created with Mapnik):
enter image description here

This overlay has to be rendered into different tiles and have zoom levels, just like a OSM base map. I want to use this overlay and put it over an area on my OSM-tiled map.

What do I need to be able to create a layer that can be displayed with OpenLayers like:
url: '/overlay/{x}/{y}/{z}'?

Best Answer

This page has an awesome tutorial on how to create a complete Tile server using the stack Mod_tile, renderd, mapnik, osm2pgsql, and a PostgreSQL/PostGIS database.

If you already have a style created by the Tilemill you can export to the Mapnik format and use it to generate your tiles and render with frameworks like OpenLayers and Leaflet.