• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 14 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cascading Sheets Of Style for Mapnik

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

More Repositories

1

mapnik

Mapnik is an open source toolkit for developing mapping applications
C++
3,628
star
2

node-mapnik

Bindings to mapnik for node.js
C++
526
star
3

python-mapnik

Python bindings for mapnik
Python
157
star
4

OGCServer

Pure python WMS
Python
138
star
5

node-mapnik-sample-code

Sample code demonstrating usage of node-mapnik
JavaScript
69
star
6

Ruby-Mapnik

Ruby Bindings for Mapnik
C++
66
star
7

mapnik-reference

JSON specification of Mapnik styling and datasources
JavaScript
49
star
8

mapnik-packaging

DEPRECATED packaging utilities for mapnik dependencies
C
39
star
9

angus-clipper

Polygon and line clipping and offsetting library
C++
21
star
10

pymapnik2

C
12
star
11

test-data

PLpgSQL
9
star
12

mapnik-gyp

GYP build system for Mapnik 3.x
Batchfile
8
star
13

clipper

C++
8
star
14

mapnik.github.com

HTML
8
star
15

geowave-plugin

Input plugin for geowave
C++
7
star
16

debian

Debian packages for Mapnik
Groff
7
star
17

test-data-visual

Visual tests for Mapnik
Python
6
star
18

mapnik-support

Use the issues queue here to ask questions and offer help on using Mapnik (maybe if this works well we can retire the mailing list at http://mapnik.org/contact/?)
6
star
19

geometry-test-data

Test inputs and outputs for cutting geometries into vector tiles
JavaScript
4
star
20

carto-spec

Language specification for the Carto stylesheet language
4
star
21

sphinx-docs

New documentation development for Mapnik
Python
3
star
22

hello-world-input-plugin

Hello world input plugin
C++
2
star
23

non-core-plugins

Mapnik plugins that make sense to keep outside of core
C++
2
star
24

mapnik-geometry

Alternative geometry implementation for Mapnik
C++
2
star
25

documentation

Mapnik docs
HTML
2
star
26

trac

1
star
27

state-of-the-flags

Tracking SVG rendering
1
star
28

node-mapnik-theme

documentationjs theme for Node Mapnik docs
JavaScript
1
star