Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Dane Springmeyer edited this page · 6 revisions
Clone this wiki locally

Changes between Mapnik 0.7.x and Mapnik 2.0


Global Changes

Underscores --> Dashes

All properties that previously used underscores, ie '_' now use dashes ('-'). So, for example: 'allow_overlap' is now 'allow-overlap'

  • Mapnik 0.7.2 has compatibility with both syntaxes as of r2579
  • Mapnik 2.0 moved to only dashes in r2582
  • properties changed include:

CSSParameters --> Properties

This change affects the PolygonSymbolizer, LineSymbolizer, RasterSymbolizer, and BuildingSymbolizer only.

All CSSParameters have been removed, so for example, this:

        <CssParameter name="fill">yellow</CssParameter>

is now:

    <PolygonSymbolizer fill="yellow" />

Changes by Element


component old new
Map bgcolor background-color
Map did not exist background-image


component old new
TextSymbolizer name='field' name='[field]'
TextSymbolizer text_convert text-transform
TextSymbolizer min_distance minimum-distance
TextSymbolizer did not exist minimum-padding
PointSymbolizer / PolygonPatternSymbolizer / LinePatternSymbolizer width removed
PointSymbolizer / PolygonPatternSymbolizer / LinePatternSymbolizer height removed
PointSymbolizer / PolygonPatternSymbolizer / LinePatternSymbolizer type removed

Python API

component old new
mapnik mapnik.Envelope mapnik.Box2d
TextSymbolizer set_displacement (function) displacement (property)
TextSymbolizer first argument was string first argument now mapnik2.Expression('[field]')
ShieldSymbolizer first argument was string first argument now mapnik2.Expression('[field]')
ShieldSymbolizer fifth argument was string fifth argument now mapnik2.PathExpression('/path/to/[field].png')


component old new
mapnik::Map getWidth width
mapnik::Map getHeight height
mapnik::Map zoomToBox zoom_to_box
mapnik::Map setBackground set_background
mapnik::Map getCurrentExtent get_current_extent
mapnik::Map zoomToBox zoom_to_box
mapnik:: mapnik::Layer mapnik::layer
mapnik:: mapnik::Envelope mapnik::box2d
mapnik:: mapnik::ImageData32 mapnik::image_data_32
mapnik:: mapnik::Image32 mapnik::image_32
mapnik:: mapnik::Image8 mapnik::image_8
mapnik:: mapnik::rule_type mapnik::rule
mapnik:: mapnik::create_filter mapnik::parse_expression

Planned/Proposed Before Release

Python API

  • Image.tostring -> Image.encode()
  • All remaining uses of 'envelope' -> 'box2d' (like ds.envelope())
Something went wrong with that request. Please try again.