When I want to make png tiles that look like ones in osm tile server what I need to do?

  1. Do I need to import data to postGIS db somehow WITH osm Carto style or I can just import it "normally" w/o style
  2. I need to convert CSS style to xml? (If the answer is yes- what is the best way to do this (I've tried with TileMill import))

  3. Last step is to do the "generate_tiles.py" script

I did mange to render files using OSM Bright, but it is not as good as the original osm look for my purpose.

thanks in advance

1 Answer 1


First, the OSM "default" style resides here, along with instructions for deploying it.

  1. You cannot import data in PostGIS without a style. Osm2pgsql requires a style file to function. There is one in OSM Bright, and there is another in the repository linked above.
  2. Yes. npm install carto (you'll need to install npm, obviously, with your package manager) and carto -l project.mml > osm.xml. The -l option is not mandatory (it's for resolving layer paths), but is a good habit.
  3. I recommend using more advanced scripts than generate_tiles. Check out polytiles and Nik4. They do not require editing their source code, at least.
  • what make this scripts better?
    – BPiek
    Jun 3, 2014 at 6:23
  • 1
    and I have problem with fonts again. Why is that- TileMill renders does not complain about fonts, so a) it does not use them so it does not look for them or b) it finds fonts that scripts cannot find. Do I have to install all the fonts manually? I don't see the fonts in project folder. (I have installed all the required fonts that are listed in project's ReadMe )
    – BPiek
    Jun 3, 2014 at 7:44
  • 1
    TileMill just silently skips fonts it cannot find. The style uses fonts installed in the operating system. Some of them are duplicate: for example, "unifont" is named "Unifont" on some systems. For my local rendering I filter some fonts out, since I don't need maps of Korea or India. Jun 4, 2014 at 10:21
  • 1
    Polytiles script does the same thing generate_tiles does: renders tiles. If you only need to test your installation, both are good for that. But when you need something advanced, like generating tiles that cover a city or a country, polytiles can do that out of the box, unlike very basic generate_tiles. As for Nik4, its documentation speaks for itself. Jun 4, 2014 at 10:24

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.