[OSM-dev] A spreadsheet to generate Mapnik stylesheets
Andrew M. Bishop <osm-lists <at> gedanken.org.uk>
2013-11-23 17:26:45 GMT
For the past few years I have used a slightly modified version of the
OSM Mapnik stylesheet on my own website. With the recent change to
CartoCSS I transfered my patches across. Both the original raw XML
format and the newer CSS type format are quite complicated to modify
(although the new format is easier than the old one).
To make creating Mapnik stylesheets even easier I have created a new
tool that is somewhat like Spreadnik  in that it uses a spreadsheet
to define the formatting. Compared to Spreadnik though it is somewhat
simpler because one line in the spreadsheet can define everything
about a single object type (for example highway=motorway).
The spreadsheet has four types of style definition sheet:
* shapefiles - for low zoom shapefiles, coastlines etc.
* areas - for polygons with optionally: solid fill, pattern fill,
* lines - for linear features with optionally: casing, fill, tunnel
and bridge styles, oneway arrows, up to two labels.
* points - for nodes (and optionally polygons) with optionally:
symbol, up to two labels.
The Perl script that processes the text files (exported from the
spreadsheet) will automatically generate a reasonably optimised SQL
statement for a group of objects and the styles and layers to draw
everything required for each zoom level.
I have written a longer description on a web page  which also
includes a download of the Perl script and the spreadsheet that
re-implements ~99% of the OSM map styles (with a few style changes).
The download is a bit rough at the moment, more like a dump of my
working version. There is also a side-by-side slippy map comparison
 of the standard OSM stylesheet and this new stylesheet (for the UK