User:Moresby/Understanding Mapnik

From OpenStreetMap Wiki
Jump to: navigation, search
Understanding Mapnik
A Mapnik tutorial
  • Contents
Starting with Python
Using XML and CSS
CartoCSS and PostGIS

Starting with Python

Setting a background colour

The absolute basics. If this works, you're ready to start. More>>

Mapnik tutorial 010-background.png

Plotting points

We start by plotting some points on a map - in this case towns and cities. There's a fair bit to take in here, but it's all important. More>>

Mapnik tutorial 020-points.png

Placing images at points

Now we choose a symbol to go at each point. More>>

Mapnik tutorial 021-points-images.png

Plotting lines

We now plot some lines - in this case roads and railways. More>>

Mapnik tutorial 030-lines.png

Specifying line colour and width

How to specify the look of a line: colour and width. More>>

Mapnik tutorial 031-lines-colour.png

Specifying line styles

For more flexibility, we can choose dotted or dashed lines. More>>

Mapnik tutorial 032-lines-stroke.png

Using layers to draw points and lines

Now we put the points and lines on the same map. More>>

Mapnik tutorial 040-layers.png

Using filters to represent data

We can choose how individual points and lines are shown, based on information about what they represent. More>>

Mapnik tutorial 050-filters.png

Adding text to the map

Now we can label some of the features we've added. More>>

Mapnik tutorial 060-text.png

Using XML and CSS

Representing map designs in XML

Now we can label some of the features we've added. More>>

Revisiting our examples in XML

Now we can label some of the features we've added. More>>

CSS styling with Cascadenik

Now we can label some of the features we've added. More>>

CartoCSS and PostGIS

Using CartoCSS

Now we can label some of the features we've added. More>>

Specifying the drawing order

Now we can label some of the features we've added. More>>

Using PostgreSQL and PostGIS

Now we can label some of the features we've added. More>>

Specifying geometry types

Now we can label some of the features we've added. More>>

The Google Maps projection

Now we can label some of the features we've added. More>>

Specifying geometry constraints

Now we can label some of the features we've added. More>>