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

I have searched for weeks on how to change my map style and have finally got an OSM.xml file (generated from OSM-Bright theme with Tilemill etc, that I am happy with here:

My tile server is using the exact steps shown here: the server can be seen here:

I have been searching for how I can update the styling of my tiles but with no luck. I assume I need to replace the osm.xml file with my new one; however it doesn't work (instead I get a mixture of out of date tiles and pink tiles (pink where the tile image isn't loading).

Could this be because my OSM.xml file is invalid? If so how can I get logs for the issue at hand? Am I following the correct way to replace a style?

I have tried to use the url method for marking tiles as dirty but it appears to not do anything. I have also have two ubuntu installs (one locally in hyper-v and the other one is the one linked. I have tried on both, with the same result).

asked 08 Jun '14, 01:29

Dessus's gravatar image

accept rate: 0%

edited 08 Jun '14, 08:13

SimonPoole's gravatar image

SimonPoole ♦

Please run renderd with the -f flag (instead of starting it via an init script) you should then see what ever is going wrong.

One of the common problems when using a TileMill generated style is that it generates one that is valid for a more recent version of Mapnik than the installed one. A frequent issue is that older version do not support the "Parameters" section, which you can simply delete. further you need to check if the values in the "Datasource" section (access config for your DB) are correct for your server installation.

permanent link

answered 08 Jun '14, 08:12

SimonPoole's gravatar image

SimonPoole ♦
accept rate: 18%

edited 08 Jun '14, 08:14

How can I upgrade my Mapnik version (I am new to linux etc). Do I use the apt-get command?

You have hit the issue on the head in that I do have errors around the parameters section (which is kinda expected I guess, considering that they have windows file paths etc). Is it better to upgrade my mapnik? or is it better to just remove the parameters.

Am I making things more difficult for myself by using Tilemill in windows? The thing that is i guess confusing me is that the OSM-Bright project seems to link 3 files into tile mill from shp files. Is there a way to not do that.

(08 Jun '14, 09:37) Dessus

The files I am referring to are:

10m-land.shp coastline-good.shp shoreline_300.shp

My tile server itself seems to have that data in the db without using those shape files. It seems like I am probably making this a bit harder than it needs to be ?

(08 Jun '14, 09:39) Dessus

just gives a 404, suggesting that Apache doesn't know that mod_tile is supposed to be serving tiles via renderd there. As Simon says, "Please run renderd with the -f flag" and share the output via e.g. pastebin or public on Google Drive.

There are at least 4 sets of "how to set up a tile server" instructions on, and what might be the problem will depend on which one you've followed, which will probably depend on which version of Ubuntu you're on and will determine which versions of e.g. Postgres, Mapnik etc. you're running.

Would it be possible to provide a few more details?

Also - was your new tile server working with a standard OSM style before you tried to use your OSM-Bright based one?

(08 Jun '14, 11:08) SomeoneElse ♦

I have to admit that I haven't tested if newer linux versions of Mapnik actually support the Parameters section, it doesn't seemed to be used in any case. I don't think that it really makes a big difference running it on windows or not, I tend to do the former.

Wrt the shape files, most OSM styles use shapefiles for coast lines and other large generalised features etc. at lower zoom levels instead of retrieving them from the database. One of the reason for doing that is that coast lines break really really often and you are better off using a static version.

(08 Jun '14, 11:12) SimonPoole ♦

The map server worked with the default style. I tried what was recommended and it seems that the following xml is causing the error here: with the specific error message of (forgive me for re-typing it rather than copy-paste):

renderd[9260]: An error occured while loading the map layer 'default': Shape Plugin: shapefile '/etc/mapnik-osm-data/C:Users\Richard\Desktop\shapedata\10m-land.shp' does not exist (encountered during parsing of layer 'land' in map '/etc/mapnik-osm-data/osm.xml

(08 Jun '14, 11:25) Dessus

(re the "c:\users\Richard..." error)

I'm guessing that you exported the osm.xml from within TileMill? When I've hit this sort of problem in the past I've just changed the relevant files to the correct path with a text editor. However a better option might be to export from the TileMill project via "carto" instead (I can't find a specific citation for that though - I may have seen it via IRC; and I haven't tried to move styles from Windows to Linux for a while).

(08 Jun '14, 11:45) SomeoneElse ♦

I don't mind using a text editor, Im just a bit confused how to translate the layers that are referencing files to the appropriate SQL query assuming that is my only issue. I have the original osm.xml and my one, but they seem quite different (and I can't find which layer in the original corresponds to the files I used (they are using different names). ie, I need:

Land, Coastline, and Shoreline shapes (which will be in my db, but not sure what layer/query serves them.

(08 Jun '14, 11:55) Dessus

Have you tried:

1) Copying "10m-land.shp" to a location on your Ubuntu machine

2) Editing "[CDATA[C:\Users\Richard\Desktop\shapedata\10m-land.shp]]" to instead read "[CDATA[/path/to/10m-land.shp]]"

Apologies if I I am completely missing the point here, but that's the approach that worked for me in the past. Specifically for me it was items in TileMill's download cache that were being referenced, but this was a year or so and several TileMill versions ago and things may have changed.

(08 Jun '14, 14:56) SomeoneElse ♦

I haven't tried that yet, but my point was that I should have the information in the database to do that currently (without using those files). Uploading a shp file could be a good idea for working around the problem for now (which might not be the worst idea, but doesn't seem optimal).

(08 Jun '14, 21:24) Dessus

The coastlines in your database are just lines. Turning them into area's requires logic that is too complex for a stylesheet. On top of that, if you are rendering a tile too far from the coast the renderer won't even see the coastlines in the database. That is why Tilemill wants you to use the shapefiles.

Edit: Are the coastlines present in your database anyway? Osm2PgSQL used to leave them out by default.

(08 Jun '14, 21:36) cartinus
showing 5 of 10 show 5 more comments

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 08 Jun '14, 01:29

question was seen: 6,904 times

last updated: 08 Jun '14, 21:39

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