In the last months there has been discussion in Europe about which country should take in what amount of refugees. In the light of that discussion I found it interesting to show the intake of refugees in the past. With the provided dataset of the UNHCR I have visualized where refugees have been taken in between 2000 and 2013. My result is a GIF of succeeding heatmaps that visualize absolute amounts of refugees taken in per year by countries all over the world. It starts with the year 2000 and the GIF continues to 2013. This is followed by a map with the sum of all refugees taken in between 2000 and 2013.
By visual analysis of the resulting video, findings can be made or suggested. The GIF shows that in the Middle East the most refugees have been taken in during the time period 2000 – 2013. It is commonly known that there have been conflicts in the region during this time period and this finding is thus logical. For further analysis I would find it interesting to add the parameters population and wealth.
Gebruikte Software Tools
Postgis (SQL), QGIS, http://gifmaker.me/
Thematicmapping, world borders,URL = http://thematicmapping.org/downloads/world_borders.php
UNHCR – The UN Refugee Agency, UNHCR Popstats Database, Dec 31, 2013 URL = https://data.hdx.rwlabs.org/dataset/unhcr-refugee-pop-stats
Gebruikte technieken & Gebruikte Werkwijze
1. Import UNHCR-refugee-pop-stats csv into postgres.
This is done by first creating an empty table with corresponding column names and correct column types. Then the csv is altered in such a way that only the data that should fill the columns is in the csv file. With the import functionality of postgres (rightclick on a table) the data is placed into the prepared empty table of postgres.
2. Import shapefile with the world borders in postgres.
The shapefile with the world borders is loaded into postgis with the standard postgis Shapefile and DBF loader 2.2 that is installed with the plugin postgis.
Prepare the data
1. Sum refugees taken in and left per country
For each country the amount of refugees taken in and amount of refugees that went out is summed. This is done by using an SQL script in which the sum function is combined with the group by functionality of SQL.
2. Relate refugees taken in and left to countries
Using an SQL script I have linked the data of the summed refugee pop stats to the countries. Both datasets contain a column with the name of a country. By using these columns it was possible to link the datasets to each other.
3. Quality improvement
By visually testing the result I found that names of multiple countries in the UNHCR refugee pop stats and the world border map of Thematicmapping do not correspond. Visually and manually I have adapted the world border map with country names of the UNHCR refugee pop stats.
1. Add postgres database to QGIS
In order to make use of the data of the postgres database in QGIS the database had to be connected. This can be done using the browser in the QGIS template. Here I could add a connection by pressing with the right mouse on postGIS.
2. Make points of the shapes of countries
In QGIS I started with making a visualization of my data. I found that in order to make a heatmap I had to use points instead of polygons. I have made points of the polygons using the ST_Centroid() function in an SQL script.
3. Make the final visualization in QGIS
By using the properties and style settings of a layer in QGIS I could create a heatmap. I have used blue and grey as colors with multiple atomized color steps in between. I used a radius of 25 millimeter and kept the automatic maximal value.
Export and make a GIF
1. Export composed prints in QGIS
With the print composer of QGIS I created a template of the visualization. The map was added over the whole template and completed with a scale bar, north arrow and title + subtitle. For each year, and the sum of all years, I have manually exported an image with the correct corresponding year.
2. Create a GIF
In http://gifmaker.me/ I have inserted all the exported maps. It automatically makes a movie of it. I have adapted the time per image to 2 seconds and have tried to export the GIF in the highest quality possible.