NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

hello, i have setup an openstreetmap server and everything works perfectly..however there are somethings that i do not fully understand...

regarding alternative styles --when you load the osm file with osm2psql into postgresql you need to pass the style.xml as a parameter.. Than implies that postgresql holds representation data (for example, colors) into the tables? I have seen the tables loaded but i did not find anything related to style... --that leads to my main confusion..for example i want to load either the humanitarial style or the osm-bright? how do i do that? do i have to run the osm2psql with a different another_style.xml into the same database? i do not quite understand how to serve different layers ? another style means another database ? some explanations would be great...

also, lets say that i want to remove all the restaurants from the tiles and add them with javascript as points with leafletjs...as far as i understand, i need to create a style with tilemill, generate the mms file, convert it with mapnik and reload the data (and then it goes to my first question)..

asked 28 Jul '17, 09:27

dmtrs's gravatar image

dmtrs
31113
accept rate: 0%


You don't pass any style.xml file to osm2pgsql. Instead you pass a .style file, which describes to osm2pgsql what columns (attributes) should be added to the database. For example, here is the .style file for openstreetmap-carto.

You can often run multiple styles from the same osm2pgsql database, so long as they have been either written to work with the same columns, or use the same .style (and .lua rules, if used) files. If you are creating your own styles it's straightforward. If you are using other people's styles, sometimes they work, and sometimes they need small changes to their SQL queries.

permanent link

answered 28 Jul '17, 11:40

Andy%20Allan's gravatar image

Andy Allan
12.5k23128153
accept rate: 28%

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:

×341
×1
×1

question asked: 28 Jul '17, 09:27

question was seen: 2,085 times

last updated: 28 Jul '17, 11:40

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum