I have set up on Ubuntu a tile server by following this tutorial

I followed the instructions for downloading and configuring osm-bright, but now I want to use the openstreetmap-carto stylesheet.

In another question (mapnik rendering with OSM Carto style) I read that after importing osm data in the postgis database with osm2pgsql (with the use of the carto.style file), then I have to convert mml to xml via carto (carto project.mml > osm.xml)

For the osm-bright to work, before converting the project.mml to .xml, first I have to edit the configure.py file and then run the "preprocessor", e.g. run make.py.

Do I have to do something similar for openstreetmap-carto?

In the scripts folder there are 3 python scripts. Should I run them all, or just one them, or none of them?

1 Answer 1


Before first use, you'll need to download some shapefiles with ./get-shapefiles.sh .

No preprocessing is necessary. The python scripts are only needed if you want to make changes to the style. For example, you must run yaml2mml.py if you make changes to the .yaml file, and want these to be reflected in the .mml file.

  • Ok got it. You also mentioned "changes to the style". May I customize the style by changing the xml which is produced by carto? More specific may I add a new layer directly to the xml? Or I have to create .mss and .yaml files compile them to .mml and then to .xml? Commented Mar 5, 2016 at 1:29
  • Changing the .xml directly will work, but is not recommended. First, your changes will be overwritten if you ever decide to upgrade openstreetmap-carto. Second, the .mml files should be much easier to read/edit/maintain than the .xml files. Commented Mar 5, 2016 at 10:28
  • My goal is to add a layer with the seamarks. By following the tutorial mentioned above I am able to generate tiles {z}/{x}/{y}.png which are served to the client. A javascript library (leaflet) then uses the tiles and adds functionality (drawing). The .xml stylesheet is responsible for reading the postgis db and styling (correct me if I am wrong). My queston is the following: Do I have to customize .mml or .xml in order to add a layer (in .mml or .xml) for the seamarks? Or should I generate other tiles ({z}/{x}/{y}.png) from the openseamap data (world.osm file only tags seamark:type=* )? Commented Mar 5, 2016 at 14:35
  • Hopefully after github.com/gravitystorm/openstreetmap-carto/pull/2081 situation should be less confusing also for other people. Commented Mar 7, 2016 at 16:49
  • In principle, you could do either. What the people of www.openseamap.org have done on their rendering, is generating separate .png files with seamarks only (example: tiles.openseamap.org/seamark/15/17484/10491.png) and adding these with leaflet on top of the openstreetmap-carto tiles as served by openstreetmap.org. That way, you don't need to deal with the openstreetmap-carto stylesheet at all. Commented Mar 7, 2016 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.