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

Hi, I struggle to set up two different map styles for the mapnik-osm rendering tool chain. According to some help I already found here and on gis.stackexchange, I have set up the renderd.conf for two map styles. But I can't get it to work. When I enter the URL for the second map style ("http://myserverurl/print/0/0/0.png") the browser says "The requested URL was not found on this server." With the default map style it is no problem ("http://myserverurl/osm/0/0/0.png").

I coulnd't find any other setting in the mod_tile or renderd config files to enable the "print" map style to work. What did I oversee or is there anything else I need to do? The renderd.conf looks like this:


[renderd]
stats_file=/var/run/renderd/renderd.stats
socketname=/var/run/renderd/renderd.sock
num_threads=10
tile_dir=/var/lib/mod_tile

[mapnik]
plugins_dir=/usr/lib/mapnik/3.0/input
font_dir=/usr/share/fonts/truetype/ttf-dejavu
font_dir_recurse=false

[default]
URI=/osm/
TILEDIR=/var/lib/mod_tile
TILESIZE=256
XML=/home/osm/openstreetmap-carto-4.24.1/style.xml
DESCRIPTION=Default map style
;ATTRIBUTION=&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/w\
iki/Contributors\">contributors</a>, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>
;HOST=http://myserverurl
;SERVER_ALIAS=http://a.tile.openstreetmap.org
;SERVER_ALIAS=http://b.tile.openstreetmap.org
;HTCPHOST=proxy.openstreetmap.org

[print]
URI=/print/
TILEDIR=/var/lib/mod_tile
TILESIZE=512
XML=/home/osm/openstreetmap-carto-4.24.1/print/style.xml
DESCRIPTION=print map style
;ATTRIBUTION=&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/w\
iki/Contributors\">contributors</a>, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>
;HOST=http://myserverurl
;SERVER_ALIAS=http://a.tile.openstreetmap.org
;SERVER_ALIAS=http://b.tile.openstreetmap.org
;HTCPHOST=proxy.openstreetmap.org

asked 19 Mar '20, 13:39

Anders2's gravatar image

Anders2
11225
accept rate: 0%

edited 19 Mar '20, 13:49

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866


Firstly, make sure to use a different TILEDIR for each style, or else the tiles will overwrite each other. (Typically you would use something like /var/lib/mod_tile/osm and /var/lib/mod_tile/print in your case.) Secondly, assuming you are using the LoadTileConfig directive in your Apache configuration: Have you done a systemctl reload apache2 (or apache2ctl restart) after adding your new style?

permanent link

answered 19 Mar '20, 13:48

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Hi, thanks for the quick reply. Yes I restarted both renderd and apache2. I read that depending on the name ("default" and "print") a seperate directory is created automatically. So far I only see the default directory in /var/lib/mod_tile/ I tried it with two different directories now as you recommended, but nothing changed.

(19 Mar '20, 14:12) Anders2

Do a

sudo -u {yourUserAccountforRenderd} mkdir /var/lib/mod_tile/print

and restart renderd and apache2 again.

If that does not help, check the error/info output at /var/log/syslog while restarting renderd.

It smells like a problem with permissions or missing shapefiles (did you load the shapefiles for the print style as well or referenced the osm-carto ones in the project.mml for the print.xml?)

permanent link

answered 19 Mar '20, 14:18

Spiekerooger's gravatar image

Spiekerooger
3.1k22356
accept rate: 16%

edited 19 Mar '20, 14:21

Thanks, that didn't work, but brought me to the solution!

(19 Mar '20, 14:30) Anders2

So the solution was: In the /var/www/ directory was only an "osm" folder (http://myserverurl/osm/0/0/0.png worked). I created another directory named like the additional mapstyle ("print"). And gave the permission chmod -R 755 /var/www.

After a restart of Apache it now serves the other map style through http://myserverurl/print/0/0/0.png.

permanent link

answered 20 Mar '20, 16:37

Anders2's gravatar image

Anders2
11225
accept rate: 0%

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
×80
×65
×20

question asked: 19 Mar '20, 13:39

question was seen: 4,021 times

last updated: 20 Mar '20, 16:37

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