Putting Anti-Poverty Activists on the Map
Using Drupal and Mapnik for the UN's StandAgainstPoverty.org

Thousands of demonstrations took place around the world this past weekend in support of the Millennium Development Goals. The truly global nature of this event is a major source of its effectiveness and its legitimacy in the eyes of the decision-makers the organizers are trying to reach. To help with emphasize this in the site, we were able to leverage other work we’ve done with Mapnik and Drupal to quickly create maps that show off this global participation in an intuitive and eye-catching manner on StandAgainstPoverty.org for the United Nations Millennium Campaign.

We had two key goals for the mapping work:

1. Keep the map simple and attractive in order to highlight the important information – the rallies, houseparties, and other events people were holding 2. Make sure the mapping stack would keep serving up beautiful maps under the massive site traffic anticipated for the weekend

Here’s how we did it:

Started with a beautiful and lightweight base map

As part of this project, we did some fantastic improvements on our custom Mapnik/Drupal mapping platform (Eric’s written about this before here). As with the Interaction project, we needed to collect real-time data from users all over the world and publish it immediately for the public. For the Stand Up Take Action campaign, we decided to take advantage of some of Mapnik’s theme functions to allow site administrators some choice in the control of the design. Below you can see that for each active layer, the Stand Up Take Action team had a variety of color options and the ability to control the display order of the data.

The results were just what we’d hoped for. The map is clean and incredibly easy to use and gives prominence to the important pre-event data we wanted people to see.

Another challenge we faced was handling the different zoom levels needed to properly display events. We wanted event organizers to specify their location down to the province level so people could use the site to find events near them. We added a GIS shapefile of provincial boundaries to our Mapnik stack, however showing these boundaries on a map like the one above cluttered it and made it hard to read. Instead, we gave the user control over which layers were shown at each level of display in the geographical hierarchy (world -> region -> country).

Check out how the province boundaries are now displayed on the map below when users zoom into the country-level display.

Performance Since we expected very heavy traffic last weekend while the events were taking place, we needed to lighten the maps’ load on the server as much as possible. So we pre-cached all of the map images that Mapnik would serve up over the weekend, making two different world overviews, five regions, and 234 individual country views – 244 images in total – ready and waiting for visitors when they arrived at the site. Along with this caching, we were also able to quickly and affordably expand the memory available for the Slicehost VPS service that we use to run our mapping servers, thanks to Slicehost’s incredibly flexible hosting infrastructure. Now that the big traffic spike is over, we’ll be able to decrease the RAM again on that machine and push the costs back down for the client to help them keep doing their good work and not waste money. (Also, a big congrats to the folks at Slicehost on your recent acquisition!).

If you want to know what else we did to improve the site’s performance, Ian Ward wrote a great post on how we used the Boost module.