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

Hi,

I followed the instructions on switch2osm setting up my own osm tile server and managed to render a small area of the osm map data. Now next I want to add another layer of the same area into the server so that the client is able to have different views of the area just like on the main osm web where I can switch to Circle Map view or Transport Map view in addition to the standard view.

I could not be able to find much information about how to do this? Any advice on this would be appreciated. Now my configuration is Ubuntu14.04 64bt + Apache + Mod_tile(renderd) + mapnik + osmbright + Postgresql(PostGIS).

Thanks guys.

asked 01 Sep '15, 11:01

dalishi's gravatar image

dalishi
1264411
accept rate: 0%

edited 09 Jan '16, 14:48

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


This is easy. You need to add the additional layers to your renderd,conf and naturally you need the added style files, for example

....
[noname]
URI=/noname/
XML=/usr/local/etc/mapnik/noname.xml

[noaddress]
URI=/noaddress/
XML=/usr/local/etc/mapnik/noaddress.xml

[has_address]
URI=/has_address/
XML=/usr/local/etc/mapnik/has_address.xml
....
permanent link

answered 01 Sep '15, 18:33

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 01 Sep '15, 18:34

1

Hi SimonPoole, thanks for your reply. I am sorry if I did not describe my case clearly. My two layers are from different data sources, e.g. maplayer1.pbf and maplayer2.pbf, both of exactly the same area. How do I set maplayer2.pbf to the postgresql database and how then configure to link the layers in the renderd probably I guess? Thanks.

(02 Sep '15, 03:32) dalishi
2

@dalishi the datasource specifications are in the style file. If for whatever reason the data is different for the two extracts you have, you simply need to import them in to seperate database instances and adapt the datasource specs. I've never actually done that myself, but I don't see any reason why that shouldn't work.

(02 Sep '15, 06:58) SimonPoole ♦

One slight caveat to SimonPoole's original answer - it appears that the layers can't be called "[default]" (which they may be if someone's come via the switch2osm instructions). Maybe this has been fixed recently (I'm using fairly old versions). However, there's no need to change the URI for the resulting tiles - just the name of the section in /usr/local/etc/renderd.conf and the name of the directory below /usr/local/etc/renderd.conf change.

(05 Sep '15, 14:17) SomeoneElse ♦
1

Hi @SomeoneElse thanks for the comments. I have tried and I can keep the [default] and add other sections below with their style xml respectively. For the URI I don't quite understand why you said no need to change. I assign each section with a URI, e.g URI=/osm_tiles/ for [dafault] and URI=/my_tiles/ for [myosm] which is my own section. I keep the TILEDIR=/var/lib/mod_tile the same though.

(08 Sep '15, 10:56) dalishi

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:

×440
×123
×105
×69
×53

question asked: 01 Sep '15, 11:01

question was seen: 6,066 times

last updated: 09 Jan '16, 14:48

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