Skip to content
This repository

Cascading Sheets Of Style for Mapnik

Octocat-spinner-32 cascadenik bumped to 2.6.6 March 28, 2013
Octocat-spinner-32 data Bumped to 2.6.2 with elimination of local dependency on test.shp for … November 17, 2012
Octocat-spinner-32 doc styling a thematic map from remote geocommons geojson December 13, 2010
Octocat-spinner-32 openstreetmap use default prefix in 'remapniking osm' style August 19, 2010
Octocat-spinner-32 .gitignore add gitignore file November 03, 2010
Octocat-spinner-32 AUTHORS.txt Added proper CHANGELOG and AUTHORS entries, made a new release November 27, 2010
Octocat-spinner-32 update dash array and requirements into the CHANGELOG March 28, 2013
Octocat-spinner-32 Moved README to markdown and added a note about running tests May 02, 2012
Octocat-spinner-32 LICENSE.txt update License date January 04, 2010
Octocat-spinner-32 set up for Cascadenik 0.1.0 release May 02, 2010
Octocat-spinner-32 Makefile Moved the One True Copy of the version number to cascadenik.__version__ May 28, 2012
Octocat-spinner-32 Added sample variables to README May 28, 2012
Octocat-spinner-32 Bumped to version 2.6.0 with addition of --style option to cascadenik… November 17, 2012
Octocat-spinner-32 Renamed special parameter 'base' to 'template' in datasource config t… September 26, 2010
Octocat-spinner-32 make executable December 08, 2010
Octocat-spinner-32 example.cfg Handle local overrides from a config file for datasources. September 26, 2010
Octocat-spinner-32 example.mml to_mapnik now includes datasources. Tests pass - we need a local shap… September 25, 2010
Octocat-spinner-32 example.mss oop September 03, 2008
Octocat-spinner-32 example_dscfg.mml Handle local overrides from a config file for datasources. September 26, 2010
Octocat-spinner-32 requirements.txt List cssutils as a dependency March 28, 2013
Octocat-spinner-32 Setuptools doesn't actually have a clue how to install PIL June 09, 2012


Cascadenik implements cascading stylesheets for Mapnik.

It’s an abstraction layer and preprocessor that converts special, CSS-like syntax into Mapnik-compatible style definitions. It’s easier to write complex style rules using the alternative syntax, because it allows for separation of symbolizers and provides a mechanism for inheritance.

Cascadenik supports many of Mapnik’s features in a simple declarative form:

/* Define a few colors */
@black: #000;
@orange: #f90;

/* Start with a white background */
    map-bgcolor: #fff;

/* Draw roads as orange lines */
    /* Usually, 3px wide */
    line-width: 3;
    line-color: @orange;

    /* Make the important ones wider */
    &[kind=major] { line-width: 4 }
    &[kind=highway] { line-width: 5 }

    /* Add the road names in black */
        text-placement: line;
        text-face-name: "DejaVu Sans Book";
        text-fill: @black;
        text-size: 12;

See more examples at


See for installation instructions.

See the doc/ folder for more usage examples.

Unroll the rules in example.mss and show their cascade order:

% example.mss > example-ordered-unrolled.mss

Compile example.mml into a Mapnik-suitable XML file:

% example.mml example-compiled.xml

Render a MML file directly to an image using

% example.mml example.png
Something went wrong with that request. Please try again.