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


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.

permanent link

answered 15 Jul '18, 16:30

maxerickson's gravatar image

maxerickson
11.0k1075155
accept rate: 30%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×313
×276
×213
×162
×85

question asked: 15 Jul '18, 15:19

question was seen: 817 times

last updated: 15 Jul '18, 16:30

powered by OSQA