This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Why do I need to specify the style when importing data to postgis? How should that work with multiple styles?

1

Why do I need to specify the style when importing data to postgis? How should that work with multiple styles?

The slightly longer version:

I'd like to setup mapnik, so that it supports multiple styles.

So far I have managed to get a tile server set up by following the instructions for Ubuntu 18.04 on switch2osm.org (and working around a couple of problems while doing that).

Having done that I want to add another style(osm-bright), but when I look at the installation instructions of the "original" openstreetmap.org style https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md then I see that I would have needed to specify that style already when importing the data to postgis:

osm2pgsql -d gis ~/path/to/data.osm.pbf --style openstreetmap-carto.style --tag-transform-script openstreetmap-carto.lua

Why does the style influence the database? How can I get multiple style to work? (Like at the german site http://www.openstreetmap.de/karte.html where I can switch between styles on the right.)

asked 15 Jul '18, 15:19

anuranpal's gravatar image

anuranpal
21101215
accept rate: 0%

edited 15 Jul '18, 15:30


One Answer:

2

Different visual styles are written against different database schemas.

The osm2pgsql style file transforms OSM data into a particular database schema. Reading through openstreetmap-carto.style is a good enough way to see what it is doing.

https://www.openstreetmap.de/karte.html is loading tiles from multiple servers, it is not rendering all the styles available.

answered 15 Jul '18, 16:30

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Source code available on GitHub .