Historical Mapping with QGIS
Installing QGIS is not as straightforward as it could be, so don’t worry if you get or feel confused. You need to download and install 3 items, QGIS and two other required small software packages. Do QGIS last, since it won’t install without the other two.
If the above links don’t work, The most up to date versions of the necessary components can be found, organized by operation system, at the QGIS download page
Shapefiles are standard file formats for conveying map information. If interested, you can read more about the standard.
You can find a number of useful directory of shapefile repositories, such as the one here.
Just for kicks, let’s find a map of all the counties in the US, one that’s listed on this census.gov page. (Towards the middle of the page, click “Download,” and then “County Shapefile” links.) You’ll notice that you actually get a directory full of files. Since we’re going to start acquiring and generating a files, you might want to create a new directory somewhere to keep everything organized, ideally somewhere that’s easy to get to (like your desktop) for the time being. You should put your county map directory in there.
Display a Map
When you first start QGIS, you’ll get a whole lot of white and a bunch of cryptic icons. The easiest way to begin is to load a map—or more accurately, a shape file.
Click on the left of the two + icons (Add Vector Layer). Choose Source Type of “Directory”, Source Type as “U.S. Census TIGER/Line” and clikc “Browse” to choose the directory that you downloaded from wherever you saved it.
You should see the outlines of the US counties. Cool.
To see more of what’s behind this data, right-click on the name of the layer that appears in the Layers column at left. Select “Open Attribute Table.” You’ll see a grid of data that comes as part of the dataset. You’ll notice that these include county names, for example, which makes things a bit more humanly readable. You can see, for example, how the county names appear in the NAMELSAD field.
Get and Display Data
This section of the tutorial rephrases some of this tutorial, which you may find useful for screenshots.
To really use the power of GIS, you need to find data that you can somehow correlate to the components of the map. In this case, we have already loaded a shapefile of US counties, so we’d like to have county data, so ideally we can find information at a county level.
Let’s see if we can find information about, say, the Civil War. A quick search for civil war data turns up an index of major battle sites. Download the Civil Battle Summaries CSV file. Open this up in a spreadsheet application like Excel. You’ll notice that a field ridiculously named “Location1″ fields contains basically the names of counties that we have already loaded into QGIS.
Basically. But not exactly. You’ll also notice that the field is in a slightly different form than we want, since it has a the two-letter state code appended to the county names. Here’s when the knowledge of simple scripting comes is extremely useful. Although creating the script has to be the subject of another tutorial, we can use a quick python script to clean up the CSV file so it’s Location1 field displays only the county name without other accoutrements. You can use the python script to fix it yourself, or you can just download the improved file.
Curiously, to bring in data in a CSV file into QGIS, you need to “Add Vector Layer,” just as we did to load the original map. This time, make sure you have “File” selected as the input type. Once you have loaded your CSV file, you should see the filename appear in the list of vectors on the left of your map.
Right-Click on the original map layer and select “Properties”.
Click the “Join” Tab (2nd from right).
Click the + icon.
We want to join this data table to our newly loaded one (called cwb2 for me). More specifically, we want to link the Location1 field of our civil war data file (though it appears as Locati) to the the NAMELSAD field in the original county data file. Select the Join field and Target field appropriately. Click “OK” twice.
Now we’ve created a link between the county shape and the Civil War battle data, based on county name. Again, this is only a “virtual” join, and doesn’t do anything with the actual files. We can see the data joined together by looking at the attributes for the original layer.
If you look at your map now, you might be dismayed to see that it looks exactly the same. But why should we expect it to be any different? We’ve created a link between two fields, but haven’t told QGIS what it should do with the new information (= civil war battle data) that we’ve linked to the county boundary data. Luckily, GQIS makes it fairly easy to automatically style the map based on the data we’ve linked it to. In particular, we can change the background color as follows:
Return to the Properties menu of the original map.
Click the Style Tab.
Instead of the default Single Symbol, choose Categorized.
Let’s adjust the background color based on “Total Est. Casualties” from our Civil War table, so select that field from the Column dropdown menu.
Choose a color ramp that you like.
Click “Classify” (which assigns a color to a value range).
You can see that QGIS has assigned a different shade of blue for each unique value in the casualties field. This could be useful depending on the values you have, but not for the ones we have.
We need to tell QGIS not to load all of our values as text, but as numbers, per these instructions.
Once we do that, we can use the “Graduated” style, with a mode like “Natural Breaks” that gives us fewer colors. You can increased the number of categories (=colors) as well.
Click “OK” and you’ll see the color coding at work.
Imagine doing this with any kind of map and your data.
Overlay a Historic Map
It can be very helpful to see historic data on modern maps, but it’s nice to see a bit more of the historic context.
First you’ll need a historic map. You can use, for example, the David Rumsey map collection. We can download a map from the 1860s. We might use something like this one. Save in the highest resolution allowed without being logged in, which will be good enough for our purposes.
Here we need to say a few words about map projections, which can be a complicated topic. When just looking at a single map, you might not think much about the particular projection. But when using different maps together, the differences in their projections need to be taken into account. For now it’s enough to say that the representation of our historic map (whatever it may be) is not going to be the same as modern county boundaries. So we’ll need to adjust (or more technically rectify) the old map to fit the new one that has our data.
If this in unclear, pretend our historic map is printed on transparent silly putty. Now imagine stretching it in various directions so all of the state boundaries line up with the modern state boundaries, and fixing it atop the modern map. We can do this, for instance, by sticking pins on certain obvious features through the silly putty and sticking them in the same features on the modern map. Thus the putty will be stretched in various directions (possibly different amounts in different places) but will ultimately come to match the modern one. Obviously this corrupts the historical value of the original.
QGIS has a built-in georeferencer that can help us to this, and you can work through a good tutorial on the necessary steps.