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

Improving Text Rendering

May 28, 2011

My Summer of Code project this year is about improving Mapnik's text rendering. There are two problems with the way text is currently rendered. I'll describe these problems and show how I intend to solve them.

Dynamic placement

When rendering crowded areas there is often no space to place a label at the point it should go to and the label therefore is dropped.


View Larger Map

In the example above many symbols are missing a label because there was no space, but they could have been shown when moved a bit. I already worked on this problem this winter and now you can tell Mapnik 2 to try different locations and font sizes. But the algorithm is quite limited at the moment and many important properties can't be changed. So the first part of my work is to add these missing features. The most important change will be that one is able to change the text. So if rendering "Example Street" fails, it could try "Example St.".

Improved formatting

The other big problem is that Mapnik doesn't have any means to change formatting in a TextSymbolizer. When you try to label a mountain peak with name and elevation like this

Name
Elevation

you need two symbolizers, one for the name and one for the elevation and calculate a appropriate offset for the second one. But if the name is a bit longer and mapnik splits it into multiple lines this calculation is wrong, the texts overlap and mapnik drops one.

My project is to add formating capabilities to TextSymbolizers. When I'm done one will only need one symbolizer for this job and the positions will adjust automatically.

Copyright © 2016 Artem Pavlenko | Downloads | License | Media