GIS Data Viz: Heatmaps and Change over Time
With data like that from SlaveVoyages.org, our maps can quickly become cluttered with overlapping symbols. The great span of time the data covers and the fact that the same ports hosted many voyages make visual representation a challenge. For that reason, we want to look beyond simple point symbols or even graduated point symbols to visualize the data. In this tutorial we’ll examine two complimentary ways of dealing with this challenge: heatmaps and a time animation.
A heatmap uses a color ramp to illustrate the relative number of points in a given area. If the color ramp goes from light to dark, this means that the lighter the visualization becomes the more points are concentrated in that area and the darker the fewer points. We are most used to seeing heatmaps in our weather reporting apps with the color range referring to things like rainfall, storm intensity, or perhaps literally heat. In QGIS, the Symbology controls make generating a heatmap very simple.
For this tutorial, we will use the data you worked with from the previous map. Open QGIS, create a new project, and name it “sv-1750-1808-heatmap.” Add the same basemap we used before, then add the CSV file “sv-1750-1808-disembark.” We’ll use this to generate a heatmap that illustrates the numbers of enslaved individuals that arrived in the Americas through this period. Once you’ve added in your CSV layer and see it on the map, do the following:
You should see a heatmap of your data now in place of individual points.
As we’ve already noted, the colors correspond to lower or higher numbers of points, each of which corresponds to a row on our spreadsheet. In this case, since each row corresponds to a particular voyage, higher values mean a greater number of ships stopped at a given port within the given time frame.
Now the colors reflect both the number of stops and the overall number of enslaved individuals represented in those stops. You should see a difference, though it may be subtle.
Take a screenshot of your map, or export it as an image file to upload to Canvas.
Another approach to visualizing change over time is a timeline. In terms of GIS, a timeline function filters your data according to a specified segment of time, for instance year by year. You can then drag a slider or simply hit play and see an animation of how your data changes from year to year. You can usually decide to see snapshots of the data as the timer progresses or see that data accumulate on your map.
To do this in QGIS, we need to install a plugin called TimeManager (a plugin is simply an added tool or feature to the program, made by an outside developer. Since QGIS is open sourced, many of its tools come in this form). To do this, simply go to Plugins > Manage and Install Plugins… in the top menu. Search for “TimeManger” and click Install. (If you get an error installing the plugin, you may need to run the following command in your terminal program: “pip3 install future.” Then uninstall and reinstall TimeManager. Please get in touch with the DSC if you are not sure what to do.)
Now let’s get TimeManager going.
You can use TimeManager with any of the symbology options available. For instance, you can animate simple points, but you can also animate graduated symbols or, as we’ve done here, a heatmap. As you do so, consider what changes you see over time. How might we explain them?
Save your map, and be sure to take a screenshot to upload to Canvas.
One final note about filtering when downloading data from SlaveVoyages.org. When you navigate to the database section of the site, you'll find a list of categories near the top of the page starting with "Year range," "Ship, nation, owner," and so on. You can set filters on each of these if you wish. We've gone over setting a year range filter in the previous tutorial.
If you want to add an additional filter that targets, for example, the principle place of purchase, you can do that by selecting "Itinerary" and then the "Place of purchase" tab. Then in the field "Principal place of slave purchase" input your search terms (e.g. "West Central Africa"). If there are results, you can check the box next to the categories you wish to include. When you've done that, click Apply at the bottom of the window. The results visible in the database should reflect what you've selected. You can verify what filters you currently have set in the light gray strip above the database results.
When you have what you want, you can download the filtered dataset by clicking Download > CSV [or Excel] > Filtered results with visible columns.