Mapnik 3.0.12 Release Sep 08, 2016 | Artem Pavlenko
Mapnik 3.0.10 Release Feb 29, 2016 | Artem Pavlenko
Node Mapnik 3.5.0 Release Feb 29, 2016 | Sam Matthews
Mapnik 3.0.9 Release Nov 26, 2015 | Artem Pavlenko
Mapnik 3.0.7 and 3.0.8 Releases Oct 26, 2015 | Artem Pavlenko
Mapnik 3.0.6 Release Oct 08, 2015 | Artem Pavlenko
Mapnik 3.0.5 Release Sep 17, 2015 | Artem Pavlenko
Mapnik 3.0.4 Release Aug 26, 2015 | Artem Pavlenko
Introducing a Color Blind Filter Aug 14, 2015 | Blake Thompson
Mapnik 3.0.3 Release Aug 12, 2015 | Artem Pavlenko
Mapnik 3.0.2 Release Jul 31, 2015 | Blake Thompson
Node Mapnik 3.4.1 Release Jul 31, 2015 | Blake Thompson

latest news

Regex replace

Dec 16, 2009

Regular expressions are very useful when working with text.

We already had ‘match’ operator which can be used in filter expressions. In Mapnik2 we now also have:

<mapnik-expression>.replace(<regex>,<pattern>)

Here is a small example :

from mapnik import *
f = Feature(1)
f["name"] = 'Mapnik'
expr = Expression("[name].replace('(\\B)|( )','$1 ')")
expr.evaluate(f)

The above should result in:

'M a p n i k'
Copyright © 2016 Artem Pavlenko | Downloads | License | Media