TileMill: More than just a headline

Reflecting the social composition of Europe and demonstrating the simplicity of popular map software like TileMill

For a long time I have wanted to create a small-scale map at country level with each country represented by the front page of its most popular newspaper. I liked the idea of it being web-based, not only so that one could zoom and pan, but also it would be pretty cool if the newspaper pages were linked images that could be updated on a daily basis. A live map of newspaper front pages – now that would be pretty cool!

Unfortunately there is no such resource, or at least I couldn’t find one – please post a comment if you know of any. Many websites claim such a thing but the reality is that they are either missing countries, i.e. have incomplete coverage, they do not have up-to-date images for all newspapers, or in most cases they lack coverage as well as currency.

My next idea was to map only the World’s most circulated newspapers. Sounds like a nice idea but visually it is very disappointing with so many countries unmapped at such a small scale. And with 254 recognised country polygons in my data I was hardly going to look for newspaper images for every one!

So instead I settled upon a map of the countries of Europe, each filled with a sample front page from its best-selling, or most popular – as I also considered free, newspaper. In terms of currency and source, this was the most manual and painstaking part of my process. Google Images helped me obtain a url for the most up-to-date, decent resolution, front page image for every newspaper on ‘the list’. This list of best-selling papers for each country was again the result of manual work with Google search engine and Wikipedia combining to give me the answers I needed.

Had I been making a map for show or for a customer, and without the need for interaction or georeference, then I may have downloaded all the images, rescaled them to fit and used the country polygons from something like Natural Earth in Adobe Illustrator as clipping masks.

But instead I decided to use one of the tools that seems to be currently fashionable – TileMill. TileMill is a free-to-download software that for many users is the starting point in creating maps for MapBox. Its appeal is that it is quick and easy to use for simple, small scale cartography. It comes with Natural Earth polygons already built-in, just like MapBox.

So let me show you just how easy my map was to build. When you open the software and create a new project, there is a tickbox for ‘default data’. It is this which loads the Natural Earth data for us.

TileMill uses code, but don’t be too scared, it is only CSS and is documented with examples. By default if you load in the Natural Earth polygons, the code window is already populated for you.

Now all I did was link the Natural Earth (NE) countries polygon data to my images by applying the images as a pattern. To do this we need to know the structure of the data. Originally I tried ‘NAME’ and got lucky but even then I didn’t know NE’s naming for each of the countries. So to get this right I downloaded the data for myself from the NE website and inspected the database (.dbf) file in Microsoft Excel (you could open the shapefile in ArcGIS and do the same).

As we can see, the country names are in a field called SOVEREIGNT (note that TileMill uses uppercase field names). And so a quick look at the documentation showed me that I can override the polygon fills with a pattern by adding the following code within the #countries styling bracket:

#countries [SOVEREIGNT = 'CountryName'] { polygon-pattern-file: url(“LinkToImage”); }


Note that https links don’t always let you grab the image, and that GIFs didn’t seem to work.

That was my map created in TileMill. I could have taken it further and matched up scaling for each image, but they didn’t seem too bad. I also like the way that the level of detail of each image increases as you zoom in. Obviously patterns is only one aspect of TileMill. Most users will be loading in geodata rather than images and the user interface for managing database interaction and import does seem pretty good although I admit I haven’t used it in anger.

The next step would be to export to MapBox which I assume would keep the same effect. However, as I have no intention of spending any money, and the free hits limit on MapBox is fairly easily reached, I instead came up with another solution.

Not quite the web mapping I had wanted but TileMill does include export to raster and vector options as stills. You simply verify extent and resolution. By doing this I was able to export a series of 4 PDFs each at a different resolution for the same extent.

This provided me with my 4 different levels of detail:
Newspapers7500 All images © Christopher Wesson 2013

Or my 4 different zoom levels:
zNewspapers7500 All images © Christopher Wesson 2013

So that’s TileMill, back to my content!

Mapping newspapers is definitely one of my better ideas and I will take this project further – so hands off! :)
From a design and cartographic perspective, I am drawn instantly to the differences in colour and typeface, Scandinavia for instance has held onto its gothic fonts. But I also realise that the newspapers all tell a story about a region’s culture, interests and socio-politics. Being hugely generalistic but at a glance Western Europe, with the noticeable exception of The Sun reading UK, seems to prefer detailed reports and analysis alongside world news in broadsheet format, whereas Eastern Europe has an appetite for local news, sex scandals and celebrity gossip in a more direct-speaking tabloid format.

The plan now is to find more time to find better image sources – preferably without copyright restrictions, and to work out a map creation process that will allow me to produce a better-finished map, for example this was quick and easy but image tiling and sizing hasn’t been refined, maybe country boundaries or names should be shown, I haven’t used any of TileMill’s effects such as line glows, perhaps I could export to MapBox and add some terrain shading. As I have PDFs I could always take these to give me a head start in Illustrator. But what this process has taught me is how quick and easy TileMill and therefore MapBox are to use and it is hardly surprising that maps and visualisations, from authors of ever-differing backgrounds, are springing up all over the place.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Get every new post on this blog delivered to your Inbox.

Join other followers: