Latest entries

Release 0.7.0

Greetings everyone,

The Mapnik team is pleased to announce release 0.7.0! There are many exciting new features, improvements, fixes etc. For the complete list see:

Thanks to all contributors! And thanks, yet again, to Dane Springmeyer for managing this release.

This is a recommended upgrade for all Mapnik users.

NOTE: New for 2010! Windows binaries now include support for both Python 2.5 and 2.6.

Posted by Artem Pavlenko on January 19, 2010

Happy New Year!

Happy New Year and thanks to everyone involved in the project! Let's have fun and make Mapnik even better for 2010.

Posted by Artem Pavlenko on January 4, 2010 | 0 comments

New Mapnik OS X Framework Installers

Download the OS X installers

Over the last year of my involvement with Mapnik I've seen a huge growth in Mapnik users running on Macs. While most ultimately deploy their mapping systems on Linux, for many it all starts on the Mac.

Macs for Mapping?

OS X, with XCode installed, is a great platform for getting up and running with Mapnik as Apple provides many of the solid *nix libraries you need to get started compiling. Apple also pre-installs a multi-architecture build of the latest Python release, which makes getting started with Python easy.

But this same batteries-includes philosophy can trip up from-source installations due to the potential for duplicate libraries and python versions, especially when users are employing open source packaging system like Macports.

Additionally...

What if you're at a conference and don't want to download the several GB's needed for the iPhone/XCode development environment just get a vanilla Mac rendering a few OpenStreetMap tiles?

What if you are deploying Mac mini's in the field and need a fast, lightweight, offline deployment setup?

Or what if you just need to get your designers up and running with Quantumnik and QGIS and don't want them to have to hassle with Python versions?

It could be easier

For all these reasons, and more, it should be easier, and it can be.

Now you can just head over to dbsgeo.com and grab the latest release or latest trunk build and you can have Mapnik running in literally minutes.

Thanks to the support from Development Seed, the great wisdom and advice of William Kyngesburye, and many months of testing from a long list of intrepid Mapnik users, these installers should be pretty solid. If you find problems or have suggestions to improve them (there are certainly lots of potential ways!) please post your reports to the Mapnik Trac site.

Posted by Dane Springmeyer on December 16, 2009 | 2 comments

Regex replace

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.create(123)
>>> f["name"] = 'Mapnik'
>>> expr = Expression("[name].replace('(\B)|( )','$1 ')")
>>> expr.evaluate(f)
'M a p n i k'

Posted by Artem Pavlenko on December 16, 2009 | 0 comments

Future Mapnik

Recently I had chance to work on new features for Mapnik, thanks to sponsorship from Richard Weait. I'm so excited about these new features, I even named the new branch mapnik2.

osm.xml

Anyone familiar with the inner workings of OpenStreetMap will know about the challenges of applying cartography to the whole planet - osm.xml (mapnik stylesheet) tells us a great deal about it (the size of the file certainly does). So far Mapnik has handled anything thrown at it, and the recent move to using XML entities in osm.xml (requires libxml2 parser) is a big step towards making things a little bit more manageable. Still, the sheer number of different Styles, Rules and Filters is overwhelming. Of course, XML is not for human consumption, but in reality this is how osm.xml is constructed - by human hand and that file isn't getting any smaller...

Every road needs a shield

There are lots of shields in Northern America. In fact, hundreds if not thousands of them. Richard Weait has written about it here. Of course, it would be great to have customized/localized highway shields and this is just about possible, but it would require hundreds of lines XML. Fortunately, Richard Weait also had an answer - dynamic parameters. Sounds good, so how can we make it work?

New expressions engine

Welcome to the new expressions engine. It's based on Boost.Spirit 2.1 (the old one was spirit1 aka spirit classic). The existing filter grammar was re-implemented to support expressions. In the past, filters would be evaluated at runtime to return boolean true/false (match/not match); now, the result of evaluation is a mapnik value - it can be any of these : bool, int, double, UnicodeString.

This naturally begs the question: 'can we evaluate other things at run-time, too?'. And, sure, we can! Currently, the mapnik2 branch allows 'filters', 'name' and 'file' attributes to be arbitary expressions. Well, 'file' actually uses special type of expressions - 'path expression' (more about this later on). And we are planning to add more support in the future. Expressions themselves can be any valid combination of the following :

Expressions

Primary expressions
Boolean true, false
Integer 123
Float 123.456 or -1.23e-04
Unicode String'unicode'
Attribute[attribute name]
Multiplicative expressions
Mult 2 * 2
Div 100 / 1.23e-4
Mod 12 % 10
Additive expressions
Plus 123 + 456
Minus 123 - 456
Relational expressions
Less than or equal to <= , le
Less than < , lt
Greater than or equal to >= , ge
Greater than > , gt
Regular expressions
regex_match (123 + 1).match('124')
[name].match('^United.*')
Equality
Equals = , eq
Not equals != , <>, neq
Logic
Not not , !
Andand , &&
Oror , ||
I added perl-like alias operators to avoid escaping in XML.
[val] ge 1000.00
looks better then
[val] &gt; &eq; 1000.0

Path expressions

Path expressions grammar is very simple at the moment. You're allowed to use attributes as part of a file path e.g
file="/opt/mapnik/osm/symbols/[highway]/[length].png"
While this is not complicated it reduces the number of redundant entries in osm.xml by a factor! It also paves the way to the multi-shield world: if only we could know which country we're in:) OSM data is not very helpful here, maybe this will encourage adding new k:v's , we'll see. Enough talking, let's have an example.

Flags of the world

Let's imagine you want to create a map of the world, where each country has its own pattern based on that country's national flag. I know this is a bit far fetched, but nevertheless it shows the concept quite clearly and the resulting map is fun. With current filter/rule logic you'll have to create more than 250 rule objects, each with its own filter to catch individual countries - hmm.. nope. With the new expressions approach we will get there with just one simple rule :

<PolygonPatternSymbolizer type="png" file="/opt/mapnik/mapnik-flags/flags/Flag_of_[cntry_name].png"/>
The [cntry_name] attribute is evaluated at run-time and we end up with a map like this one, great!:

flags

Posted by artem on December 8, 2009 | 0 comments

Release 0.6.1

Mapnik team is delighted to announce 0.6.1 release of Mapnik. Big kudos to everyone for their great work. I hope you're all having fun, I certainly am :). There are lots of bug fixes along with new features. More details can be found here:

Get Mapnik

BTW, SOTM 2009 was awesome. Lots of interesting maps, most of them rendered with Mapnik. My favourite is:

map cake

Posted by Artem Pavlenko on July 14, 2009 | 2 comments

State of the Map 2009

SOTM 2009

I hope to see you there!

Posted by Artem Pavlenko on July 8, 2009 | 1 comment

Release 0.6.0

The Mapnik team is pleased to announce our 0.6.0 release.

This release has tons of new features, improved stability and better usability.

It has been made possible by contributions from our growing Mapnik community! Special thanks to Dane Springmeyer for all his efforts along the way. To see release highlights and a full list of new features:

Thanks to everyone involved for their great work!

Get Mapnik

Posted by Artem Pavlenko on April 1, 2009 | 2 comments

Release 0.5.1

Hello all, I'm pleased to announce 0.5.1 release.

This is a minor bugfix release; it is a recommended upgrade for users of 0.5.0. This release includes the following changes:

  • builds with GCC 4.3
  • re-enables regex support, which was inadvertently disabled in 0.5.0
  • add better error handling to shapeindex
  • support ppc64 builds
  • fix division by zero error in placement_finder.cpp with multiple loops

Big thanks to Dominic Hargreaves for making it happen!

Posted by Artem Pavlenko on April 15, 2008 | 5 comments

Mapnik consulting

Mapnik Consulting

Hello all!
I would like to introduce Mapnik Consulting. I have been consulting for a few years now, but I think the time has come to move things up a gear. Have a look, it even has 'rounded' corners:).

While Mapnik itself plays a central role, my consultancy goes beyond just rendering maps. We offer a wide range of geospatial services.

This in no way means that Mapnik will be overlooked, if anything I'm hoping to increase the pace of development!

Cheers!

Posted by Artem Pavlenko on March 11, 2008 | 1 comment

Custom maps with Mapnik (part 2)

The people behind OSM Cycle Map have recently added contours. Combining contours with street level data is no trivial task, but Andy and Dave yet again have come up with an attractive solution. If you're a cyclist you know how important it is to see if you're going to be heading up or downhill!

There are some very nice examples on their site, do check them out.

I was looking for places I cycled in the past and here is my favourite for today:

It hasn't been mapped by OSM yet, but there is a lovely cycle route you might try. Starting from the mainland (Glenelg), cross by the small car ferry to Skye. Head straight up the valley in front of you - where you might feel those contours in your legs - and on over the hills till you hit the A87. There are great views on the way (weather permitting). Turn right and back to the mainland (Kyle of Lochalsh) over the (ex)Toll bridge.

Posted by Artem Pavlenko on February 22, 2008 | 1 comment

Mapnik goes Unicode (properly)

Well, we had "Unicode" for a while in Mapnik - first it was ad-hoc utf8 and latin1 to UCS-2/4 transcoders, then iconv and fribidi. It kind of worked (sometimes) but it wasn't a proper solution. There were a few problems with the previous approaches - std::wstring is not portable, fribidi was choking in multi-threaded rendering and had to be disabled.

Result? It was constantly brought to my attention by Morocco in OSM and others. Arabic is a "right-to-left" language for starters and it also requires "shaping" (this is when characters change depending on where they are in the text to form smooth connections between letters).

So here is the solution - ICU. I hope it will be final :).

Posted by Artem Pavlenko on February 20, 2008 | 2 comments

Custom maps with Mapnik

For those of you who don't follow Django - there is a great new project out there - EveryBlock. Adrian Holovaty and the team have been busy putting local information on the web, giving people chance to check everything from restaurants violating the NY trans fats ban to lost property. It is very nicely put together and it's Django of course.

There is an interview with Adrian where he talks, amongst other things, about the technology behind the scenes, which includes Mapnik. Also, the developer in charge of maps Paul Smith describes the reasoning behind their decision not to go with the usual suspects - Google, Yahoo!, or Microsoft.

It is really great to see Mapnik being used to create highly customized, beautiful cartography!

Posted by Artem Pavlenko on February 19, 2008 | 0 comments

Mapnik 0.5.0 Debian packages

debian "..Just wanted to let people know that packages of Mapnik 0.5.0 should have hit the mirrors by now, in unstable, for the use of anyone using this fine distribution."
Great work! Thanks Dominic

Have fun!
Artem

UPDATE : mapnik (0.5.0-1)

Posted by Artem Pavlenko on February 16, 2008 | 1 comment

Release 0.5.0

I'm very pleased to announce Mapnik 0.5.0. It has been a long time in development, but I hope it was worth waiting for. This release brings numerous stability and performance improvements. I am particularly excited to see Mapnik performing well in multi-threaded setups, offering scalability.

During 2007, Mapnik has been deployed in a number of diverse environments, rendering maps 24/7. Here are some people who use Mapnik :

List of some new/improved features:

  • support for native builds on Mac OS X (both Tiger and Leopard)
  • support for single/multi-threading variants
  • gdal raster support
  • more comprehensive text label placement functionality (min_distance, spacing)
  • viewer - qt4 based application
  • character encoding support (iconv)
  • changed internal geometry representation to explicitly support multi-geometries
  • placement_finder is re-factored
  • optional libxml2 based map loader (internal and external entities)
  • image quantization
  • support for image 'views'
  • improved 'memory file' based i/o in shape input plug-in
  • support for 'numeric' type in postgis input plug-in
  • saving images directly into Python string
  • win32 binaries built with VC++ express

***This is a major feature enhancement as well as a bugfix release and everyone is encouraged to upgrade***

Thanks to everyone involved, I really appreciate your help. And let's make Mapnik even better this year!

Artem

Posted by Artem Pavlenko on February 7, 2008 | 8 comments