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

Stamen, Compositing, and Mapnik 2.1

Aug 27, 2012

What if software existed that combined the power of Photoshop-like image effects with Illustrator-like vector transformations that was fully open source, spatially capable, and could handle big data like OpenStreetMap? Well, hopefully this future will feel near as you start using Mapnik 2.1.

A compositing framework in core

In time, Mapnik 0.7.x added support for blending modes in rasters thanks to the work of Marcin Rudowski. And as of last week, with the release of Mapnik 2.1 and a ton of work from Artem, we now support the comp-op property on all symbolizers (and Styles) making compositing possible for both vectors and rasters, together. This new support is a solid framework to build on, and more modes can now easily be added with few code changes.

Thanks Stamen

Our friends at Stamen Design have been advocating for the value of Photoshop-like alpha blending in mapping for many years. As far back as 2008 Mike was already beautifully working around limitations in Mapnik for terrain hillshading and proactively advocating for better support by writing new software like TileStache. Shawn was instrumental in helping me see the viability of compositing in Mapnik by helping sketching out ideas on the Mapnik wiki. Last week I saw Shawn advocating for the full suite of advanced photoshop blend modes in the upcoming CSS Spec, which is awesome and something we can also do in Mapnik.

Revisting innovations

After reflecting on how far we’ve come in Mapnik and thinking of Shawn’s work I was reminded of his sweet little project called Trees, Cabs & Crime where he experimented with rendering three themes of point data and compositing them together using subtractive blending to bring out patterns of correlation.

Trees, Cabs & Crime in San Francisco from Shawn Allen

Now that Mapnik 2.1 is out I figured it should be doable to render Shawn’s exact map with just a single Mapnik stylesheet.

Trees, Cabs & Crime re-rendered in Mapnik 2.1

After finding Shawn’s makefiles I saw the process should be as simple as reading data from three csv files and using a darkening blend mode as the canvas of each layer is rendered. Mapnik 2.1 newly supports reading direct from CSV files and one of the supported comp-op modes is darken, so matching Shawn’s exact output was pretty straightforward. You can find the full Mapnik XML below:


And soon after this post Shawn got things working in TileMill 0.10.0 (which uses Mapnik 2.1).

Copyright © 2016 Artem Pavlenko | Downloads | License | Media