TransWikia.com

Adding custom layer to OSM data in switch2osm?

Geographic Information Systems Asked by Mahdi Nazari on September 5, 2021

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?

One Answer

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.

Answered by SomeoneElse on September 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP