I have followed this link to implement serving multiple tile styles from tile server. It says that I just need to update .xml style file path in renderd.conf file. But the openstreetmap carto recent 4.x releases requires specifying --style and --tag-transform-script(lua) during osm2pgsql data import. And if I do that, osm-bright tile serving is not working.

I tried -

sudo osm2pgsql --drop --hstore-all --slim -r pbf -C 32000 --style  /data/
/styles/osm/openstreetmap-carto-master/openstreetmap-carto.style --tag-transform-script  /data/
/styles/osm/openstreetmap-carto-master/openstreetmap-carto.lua  --flat-nodes 
node.cache --number-processes 8 -d gis -U root /data/nydata/new-york-latest.osm.pbf

After this, if I run-

renderd -f -c /usr/local/etc/renderd.conf

It is showing errors for osm-bright style because osm2pgsql query contains openstreetmap-carto.style instead of default.style(default.style is required for osm-bright).

So my question is what should be the correct osm2pgsql query for .pbf data import so that I can use same database for osm-bright and openstreetmap-carto styles both? Or What should be the steps to make a tile server that serves both openstreetmap-carto and osm-bright tiles?

1 Answer 1


You'll need two different databases, since the one that OSM Bright needs is a different format to the one that OSM Carto needs.

What I tend to do is to generate the mapnik.xml as normal and manually update the database references in there from "gis" to "whatever your 2nd database is called". If you're using renderd it's possible to have multiple styles defined per renderd.conf. In this example "ajt" is one map style; another section would point to another mapnik.xml which in turn would reference a different database.

  • Can you please give me an idea of how much disk space is required for maintaining two databases? @SomeoneElse
    – APL
    Commented Aug 2, 2018 at 8:52
  • I've not explicitly measured, but as the data's separate, I'd expect it to be twice roughly as much as one database. It'll depend on the style of course - I'd expect that OSM Bright would need a smaller database (because less data is rendered) than OSM Carto. for example. Commented Aug 6, 2018 at 20:08

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.