On the MapBox website we describe TileMill — the project we’re working on with our 2010 Knight News Challenge grant — as “a toolkit for rendering map tiles”. To be more specific, it’s essentially a “glue layer.” TileMill is built on top of a cocktail of other open source mapping software projects, and its biggest value is streamlining other more complex tools into a clean and easier workflow. For users to take advantage of TileMill, it can be useful to understand some of the underlying parts. Perhaps the most important part of that cocktail is a lesser known open source project called Mapnik. In this post I’ll talk a little about what Mapnik is and the important role it plays in helping users style their maps, as well as how it relates to TileMill.
The goal of the TileMill project is to make it easy for anyone with some basic web design familiarity to design their own custom maps. In past posts on this site we’ve introduced readers to the general reasons why we think custom online maps are valuable and have shared a couple examples for when custom maps have been particularly helpful on websites. Mapnik makes all this possible by providing the core technology to apply styles to GIS data and then render maps based on those styles.
Here’s the basic idea with styling maps: raw GIS data in the form of shapefiles contains information about various “features” — for instance, place names, points (e.g. center of a city), lines (e.g. roads), or polygons (e.g. state or country borders). If you have the data in its raw form, you’re only part of the way toward turning it into a map. Next you need to decide how to style each element.
Mapnik in action, styling maps of Kabul, Afghanistan
The style of each feature (or lack thereof) is why maps of the same location might look different from others. At a simple level, you might want your primary roads to be red versus orange. Compare MapQuest to OpenStreetMap for instance, at the exact same zoom level — note the difference in the styles for the same features.
Screenshot of Boulder, CO on MapQuest
Screenshot of Boulder, CO on OpenStreetMap
Setting aside conversations about which features you decide to show on a map and assuming your data is accurate (both are huge factors), how you choose to style certain features might be the next most important part of map design. Getting styling right is essential for your users and is central to map design. If you over style or under style features, it has a direct impact on the readability and effectiveness of your maps.
This is where Mapnik comes in — it provides the framework for styling map data and then rendering new maps based on those styles. Mapnik is an open source project that is heavily used by the team at Cloudmade, who are actively involved in custom styling of OpenStreetMap data, and it’s been used by MapQuest, who have even released their Mapnik map style files for the public. Our team uses it heavily too, and AJ Ashton and Tom MacWright from the MapBox team were recently in London at Cloudmade’s offices with a group of core contributors, including Mapnik’s creator Artem Pavlenko, for the first ever Mapnik code sprint.
But where professional mappers are able to leverage Mapnik in complex ways, it has its downsides for the average would-be map designer. For starters, it’s not easy for noobs to even install it. This is part of why we’re working on TileMill — we want to make it easier for people to take advantage of these powerful tools. TileMill puts a wrapper around Mapnik that makes it simple to set up and leverage the powerful map styling capacity that it provides.
If you’re interested in more details about Mapnik, check out the Mapnik website or a recent Q&A with Mapnik developer Dane Springmeyer about Mapnik performance on Development Seed’s blog.