Customizing OSM Bright styles for Mapnik to render
Posted by mholmes on 27 Jun 2016 in Servers, Activity log, Documentation
We've determined that it's not practical to use the MapBox Classic editing tool to create styles and then generate tiles from them, because the resulting project.xml file does not contain any of the required SQL for pulling data from the PostgreSQL database. Instead, this is what we need to do:
- Clone the OSM Bright repo from https://github.com/mapbox/osm-bright.git.
- Customize the mms files to make the changes we want. There's going to be a certain amount of trial and error here, unfortunately, so a quick-and-dirty small-scale rendering job would be a good testbed.
- Download the land polygon files from OSM, unzip them and run shapeindex on them as instructed in the readme file in OSM Bright.
- PROBABLY NOT NEEDED: Create configure.py from configure.py.sample, providing the dbname (which is "gis"); I don't think any other info is needed. Also configure the project name.
- Run
carto osm-bright.osm2pgsql.mml > osm-bright.xml
in the osm-bright subfolder. This should create the XML for Mapnik, configured with the correct PostgreSQL select statements. - Build some tiles with that on the tile server, using generate_tiles.py.
This is gnarly and untested. Will edit as appropriate.