Mapnik 3.0.16 Release Nov 16, 2017 | Artem Pavlenko
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

latest news

Latest from mapnik development team

Feb 10, 2012

Text placement re-factoring

Big merge this week : both text-placement (Herm) and feature_impl branches got pushed to the mapnik/master.

One of the goals for “text-placement” was to re-factor rather messy text placement code into more manageable chunks, and hopefully to make it easier to follow and implement new features. So, now we have a better framework for text labeling - let’s use it. A classic example is labeling multipolygons that make up one geographical entity; country, county or state etc. Here are some maps to demonstrate how this would work for the US states :

1) Labeling regression (actually it never worked properly but changes to how multi-geometry is processed in Mapnik exposed this):

regression

2) Try and label every polygon:

all polygons

3) Order polygons by “size” and place label in first largest polygon:

largest-only

[3] is now current default behaviour in master, giving a much better cartographic result. We need to expose other possible options in XML/Python/Node etc.

Feature concept changes

New ‘context’ based feature implementation landed in Mapnik. The interface was preserved as much as possible to make it easier to update existing code: the following Python code shows the differences with the new approach:

>>> import mapnik
>>> ctx = mapnik.Context() # create Feature context
>>> ctx.push("NAME") # push some names, defining a schema 
>>> f = mapnik.Feature(ctx, 1) # create feature by passing context and ID
>>> f["NAME"] = "test"

The main gain here is a memory footprint and faster feature construction - no overhead of maintaining std::map per feature. Looking to the future, it will be interesting to see how we can leverage this for more robust/compact interchange formats.

Copyright © 2016 Artem Pavlenko | Downloads | License | Media