I'm new to switch2osm and I've created an OSM Tile Server with switch2osm on Ubuntu 16.04 LTS. It uses Apache, Mod_tile, renderd and Mapnik to render tiles. It uses PostgreSQL as DBMS and osm2pgsql to import Open Street Map shape files to database (I've downloaded my shapefiles from Geofabrik).

I want to add my own layers (like my GPS data of my organization) to PostgreSQL and style them through Mapnik to be shown on the tiles. How can I do this?

1 Answer 1


Just for completeness, there are actually many slightly different ways you can acheive what you want:

You can create a map using something like Leaflet using your background tiles and draw things on top of that directly with Leaflet (probably the easiest solution if you're not adding much extra data). See https://leafletjs.com/examples.html for info.

You can create multiple raster tile layers using different databases and using something like Leaflet display multiple layers to the client. https://www.openstreetmap.org/user/SomeoneElse/diary/47007 describes this, though I'm sure that there are other and better examples.

You can do what you suggested in the question and render your data together with OSM's data. You'll need to:

  • Create a .osm file of your data, tagged with a tag that you've created
  • Merge it with the OSM data
  • Change your data style to render your special tags
  • Load the combined data set and render it with your new style

It should be noted that the normal "switch2osm" approach is to not "to import Open Street Map shape files to database", so I wonder if you really have done that. If you really do want to follow this last option through it's probably best to take each step one at a time.

  • Thank You very much for your answer. I don't know which tools can be used for creating .osm file and tag them. And what should i use for style them? Commented May 23, 2019 at 19:00
  • The stackexchange format doesn't really work for questions (especially very wide-ranging ones) asked in comments, but maybe pointing to an example will help. When I created the map legend for map.atownsend.org.uk/maps/map/… I needed the create a .osm file which is merged in with other data. The linear features you can see there are just edited using a text editor, the point features created using a simple java program that creates a .osm file. See github.com/SomeoneElseOSM/SomeoneElse-style-legend for scripts and data. Commented May 27, 2019 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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