This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Cascading Stylesheets For Mapnik

Project Description
Cascadenik
==========

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
{
map-bgcolor: #fff;
}

/* Draw roads as orange lines */
#roads
{
/* 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 */
name
{
text-placement: line;
text-face-name: "DejaVu Sans Book";
text-fill: @black;
text-size: 12;
}
}

See more examples at https://github.com/mapnik/Cascadenik/wiki/Examples.

Usage
-----

See `INSTALL.md` for installation instructions.

See the `doc/` folder for more usage examples.

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

% cascadenik-style.py example.mss > example-ordered-unrolled.mss

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

% cascadenik-compile.py example.mml example-compiled.xml

Render a MML file directly to an image using nik2img.py:

% nik2img.py example.mml example.png
Release History

Release History

This version
History Node

2.7.0

History Node

2.6.6

History Node

2.6.5

History Node

2.6.4

History Node

2.6.3

History Node

2.6.2

History Node

2.6.1

History Node

2.6.0

History Node

2.5.2

History Node

2.5.1

History Node

2.5.0

History Node

2.4.3

History Node

2.4.2

History Node

2.4.1

History Node

2.4.0

History Node

2.3.0

History Node

2.2.0

History Node

2.1.1

History Node

2.1.0

History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cascadenik-2.7.0.tar.gz (54.2 kB) Copy SHA256 Checksum SHA256 Source Jun 17, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting