Wednesday, 30 September 2015

openstreetmap - mapnik rendering with OSM Carto style


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



Answer



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...