Showing Refugees Some Love

The terrorist attacks in Paris on November 13 brought renewed attention to the movement of refugees from Syria to the West. Unfortunately, much of this attention has been negative, despite the fact that refugees are fleeing the very brutality that was unleashed on Paris. The rhetoric from the Republican presidential candidates in the U.S. has been particularly vile. However, many people around the world continue to welcome refugees and show compassion. That’s why I made this visualization:

This map shows positive media coverage of refugees over the past 24 hours (updated hourly). Each animated marker represents one positive media mention about refugees in a particular location.

The data comes from GDELT (The Global Database of Events, Language, and Tone). GDELT’s Global Knowledge Graph monitors media in 65 languages around the world and uses algorithms to measure the emotions and tone of the texts. The map shows results on the theme of “refugees” with a tone of greater than two. Tone is the most basic GDELT parameter, and measures how positive or negative a media article is. So, for example, this article about how churches in Kansas and Nebraska are ready to help refugees is included in the dataset.

How I made the map

This map is a nice demonstration of some useful CartoDB features, such as sync tables, animation, and custom map projections.

I used the GDELT Global Knowledge Graph API to pull the data and load it into CartoDB. The exact API call is:

http://api.gdeltproject.org/api/v1/gkg_geojson?QUERY=REFUGEES&TIMESPAN=1440&OUTPUTFIELDS=url,name,tone&OUTPUTTYPE=2

This returns a geojson file with all the results over the last 24 hours tagged with the “refugees” theme. Using CartoDB’s sync tables you can set the data table to update automatically. Mine updates every hour.

I filtered the results to only include articles with a tone score of greater than two (positive coverage), and then used CartoDB’s Torque tool to create the animation with a custom marker (the heart).

The map projection is a modified Bonne, with the standard parallel set to 90 degrees North to make it appear more heart-shaped. Here is a useful tutorial for using different projections in CartoDB.

Inspiration came from this blog post, and this tutorial was very helpful in figuring out how to use the GDELT API. You can access the data from my CartoDB page here and easily create a map of your own.