John Garrigus

Researching Saint-Domingue and the Haitian Revolution

Category: GIS

Texas in QGIS: Geo-referencing Historical Maps

This tutorial is designed so you can practice the skills you learned in the Programming Historian QGIS Tutorial “Geo-referencing in QGIS”

  1. [Note for future work: Each time you install a new version of QGIS, be sure to activate the Georeferencing toolbar in that installation]
  2. Open a new project; set the CRS by typing 3081 in the filter box and choosing “NAD83 / Texas State Mapping System”
  3. Set up your modern georeferencing ‘canvas’
  4. Add Vector and load StratMap_County_poly.shp [a modern shapefile] to serve as georeferencing canvas.
  5. Add Vector: txdot-2015-city-point_tx.shp
  6. Add Vector: txdot-2015-city-poly_tx.shp
  7. For all – change the “properties” so they are not solid. Turn “labels” on for one of the city files [you may have to use both of them]
  8. Download an 1800s map from UTA’s Cartographic Connections website: http://libguides.uta.edu/ccon
  9. Use your image viewer software [ie Microsoft Picture Manager] to convert the JPG file to TIFF
  10. Use the georeferencer to add the TIFF version as a raster layer and add 6 or more control points
    • Use manmade boundaries, not coastline or rivers which can change
    • Use large cities, ports, or military bases that would have had precise lat/long readings in the 1800s
    • Have at least 3 in the western part of the state
    • Have more than 3 in the eastern part of the state, in heavily populated areas
  11. Specify transformation settings
  12. Compare geo-referenced map to modern shapefile
  13. Possible: create new vector layers to capture data on the old map

Data sources for this tutorial

  1. Basemaps: https://tnris.org/maps-and-data/ — search for political boundaries
  2. Historic maps: UTA’s Cartographic Connections: http://libguides.uta.edu/ccon

How to Convert map-image files

  • From JPG to TIFF: Most image viewers will do this. For PC, use www.irfanview.com [pc] or Microsoft Picture Manager
  • From SID to TIFF; irfanview can do this; search the web for other utilities

 

“Table-Joins”: Bringing an Historical Dataset into QGIS and Connecting it to Spatial Data

This tutorial is inspired and adapted from Jamin Wells, “How to Map Historic Census Data with QGIS,” from his Ships on the Shore blog. Accessed 4-17-2016 from https://shipsontheshore.wordpress.com/2016/02/08/how-to-map-historic-census-data-with-qgis/

Download the data

  1. Go to NHGIS.org and create an account. Once they have emailed you and you have confirmed your identity, then log into the site. It will take you to the Data Finder page.
  2. In the “Apply Filters” column, click on “Years”. In the table that opens up, select “1800” in the “Decennial” column, then “Submit” at the bottom. Then, click the ‘plus’ sign next to the first item in the Select Data table of data. This should be “NT1. Total Population” and it should be in the “source tables” tab, which is the first of 3 tabs.
  3. This one source table will then appear in the “Data Cart” in the upper right hand corner of your screen.
  4. Now click to the 3rd tab in the Select Data table, labelled “GIS boundaries”. It will list the GIS boundary files for states and counties for 1800. Choose the first county [not state] file by clicking the “plus” sign. It should now appear in your data cart.
  5. Click the green “Continue” button on the Data Cart. The website will prompt you to choose the geographic level you want for the 1800 source table. Choose ‘county’ and then click “Continue” again.
  6. The website will now provide you with a download page, called “Extracts history” By clicking on “tables” and “gis” you can download the two sets of files.

Perform a Table-Join: Merging a shape file (.shp) with comma separated data(.csv)

Note: Material under this heading is taken directly from the Wells tutorial, editing is noted with bracketed ellipses and comments

  • Open QGIS. Start a new project. [JG: set the CRS to NAD83]
  • Create a new shapefile layer. This is the basic foundation of the map. Open the zipped 1800 shapefile you downloaded from NHGIS. You should see a map of all 427 counties from the 1800 U.S. census. Use the mouse to zoom in and out. Grab and drag the map around. Play around with the buttons on the top toolbar.
  • Now it’s time to upload the census data. Create a new “delimited text file” layer. This, of course, is census database.
  • [JG: Use “Add a Layer” and choose “Add delimited text layer”] Add the census CSV file you downloaded from NHGIS.
  • Be sure the “file format” is set to “CSV (comma separated values)”
  • For “Geometry definition” select “No geometry (attribute only table)”
  • Click OK.
  • […] You should see the new layer in your “Layers Panel” on the right. Now we have to put the numbers into the map.
  • Right click the shapefile. Click “Properties”
  • Click “Joins”
  • Click the green “+” symbol to join the two layers together.
    • Set “Join layer” to the .csv file
    • Set “Join field” to “GISJOIN” (thank you NHGIS for making this easy!)
    • Set “Target field” to “GISJOIN”
    • Press OK. This should put you back in the shapefile “Properties” dialogue box.
    • Click “Fields.” Scroll down. You should see all the [population] data for every [county] census [in 1800]. Smile – that’s pretty amazing!
  • Now it’s time to display some info on our map. In the “Properties” dialogue box of the shapefile. Click “Style.”
  • Now it’s time to display some info on our map. In the “Properties” dialogue box of the shapefile. Click “Style.”
  • Change the dropdown box on the top from “Single Symbol” to “Graduated”
  • Change “Column” to the 1800 data (my file reads: nhgis0001_ts_nominal_county_AOOAA1800) [your file may have a different column name, like “nhgis0002_ds2_1800_county_AAS001”]
  • Click the “Classify” button. You should see the box in the middle of the dialogue box populate with symbols, values, and legend entries.
  • Press “Apply” then “OK.” You’re looking at a population map. It probably doesn’t look too awe inspiring at the moment.
  • Go back to the “Style” dialogue box (right click shapefile, “Properties,” “Style.”
  • Play around. You can’t hurt much (and if you do, it’s easy enough to start over). I suggest starting with the “color ramp,” “precision,” “mode,” and “classes” buttons. Remember: every time you make a change you have to press “apply” to see how it changes your map. [JG: “Natural Breaks (Jenks)”]
  • Population is great but I want population density. Here’s how we get there

Create a new column based on data in the newly merged file

Note: This explanation is from Garrigus

  • Right click shapefile, “Properties,” “Fields”
  • Click on the abacus button, which is the “Field Calculator” which puts you into the “Expressions” dialog box. You are now going to build an equation to show population density.
  • Under “output field name” type “Pop_densit”.
  • For “output field type” chose “Decimal number (real)”
  • Change the “precision” value to 4
  • In the middle box, click on the “Fields and values” plus sign to expand it.
  • Double-click the name of the column that shows the population of each county. It might be “nhgis0002_ds2_1800_county_AAS001”. That puts it into your equation.
  • Click on the slash mark/division sign to put that into your equation.
  • Click twice on the left-parenthesis button to put (( in the equation.
  • Expand the “Geometry” field in the central box. Double-click “$area”, which is a function that will calculate the area of each county in square meters.
    • Add the divide sign
    • Type in 1000000 [1 million, or 1 followed by 6 zeros]. This converts square meters into square kilometers.
    • Add a single right parentheses — )
    • Add the multiplication symbol — the asterisk
    • Type “0.386102”; this will convert square kilometers into square miles
    • Put in a final right parentheses. The “expression ” box will now read something like nhgis0001/_ts/_nominal/_county/_A00AA1800/(($area/1000000)*0.386102)
    • Click OK
  • Now you are back in the “Properties” screen. Click on “Style” and change the top button to “Graduated.” Now select the column. You should find the new column “pop_densit” at the very bottom of the dropdown list.

Note: back to Wells’s text

  • Click “classify.” The symbols, values, and legend figures in the dialogue box should have changes. Change the mode to “mode” to “Natural Breaks (Jenks),” pick a “color ramp” that makes sense, click “Apply” and “OK.”
  • There you have it: county-level population density in 1800. QGIS is amazingly versatile and adaptable and time spent “playing” with the representations is time well spent because only by going through the process of analyzing the data in different ways do you start to see new connections and patterns, which, of course, is one of the beauties of using GIS.

US Population Density in 1800, from Wells

Note: Quoted Wells material ends here

What you have made is a “choropleth” map. If you zoom in on locations you suspect will be more densely populated, you should see darker colors generated by the 1800 data.

Formatting Your Own Data: Two Options

The data that you create yourself won’t be as nicely formatted as that from the NHGIS unless you do that formatting yourself. Specifically you need to tell QGIS which of the columns are text (or “strings”) and which are numbers (or “integers”) There are two ways to do this.

Unfortunately neither one works well with Microsoft Excel. Excel CAN save files to the CSV [comma-separated-value] format. But it does this in a way that is confusing to QGIS.

Instead use the open source Libre Office. It has “Calc,” an Excel equivalent. You can open your data [even if it was created in Excel] in Calc. Then you can do one of two things.

EITHER

Save your spreadsheet data in the DBF format and import that into QGIS as a regular vector file [not as a text-delimited file]. See https://www.mapbox.com/tilemill/docs/guides/joining-data/ for a tutorial

OR

Save the spreadsheet data in the CSV format.
– Then use a plain text editor to make a file with the same name, but ending in .csvt. That file needs to have a single line with the words “STRING”,”STRING”,”STRING”,”STRING”,”STRING”,”INTEGER”, [including the quotation marks and commas] where each of the words stands for each of the columns in your file.
– QGIS will use this csvt file to identify the kind of data you are importing. If you don’t do this, QGIS thinks every column is text [or “string”] and you won’t be able to do mathematical operations like calculate population density.
– Import that csv file as a text-delimited file. QGIS will find the cvst file because they have the same name and are in the same directory.
– For a tutorial on this method, see http://www.qgistutorials.com/en/docs/performing_table_joins.html

 

New Orleans in QGIS: Creating New Vector Data from Historical Maps

This tutorial is designed to reinforce the skills you learned in Programming Historian QGIS Tutorial#3

  1. Download the NOLA zipfile from Blackboard and unzip it to a folder on your computer.
  2. Start a new project; set the CRS: type 26982 to bring up NAD83/ Louisiana south
  3. Add Vector: Load the NaturalEarth [ne] shapefile basemap for Louisiana: ne_Louisiana_10m_admin_1.shp; Turn the fill color off
  4. Add Vector: Load the Open Street Map [OSM] shapemap basemaps for New Orleans – go in this order and look at each. As you look for the files, notice the size of each of them. [Which file is the largest? Which is the smallest? Why?] Once they load, use the right-click “Zoom to Layer” feature and then the magnifying glass. Drag them into the stack-order that makes the most sense to you.
  5. OSM_NOLA_land_coast_polygons.shp
  6. OSM_NOLA_admin_any.shp
  7. OSM_NOLA_waterareas_any.shp
  8. OSM_NOLA_roads_any.shp
  9. OSM_NOLA_buildings_any.shp
  10. Turn labels on for the roads layer so you can see the names of the roads
  11. Turn the buildings layer off to make the map easier to view
  12. Add Raster: Load the 1854 Norman Map [this is actually a late 1800s re-creation]. Note: I have already georeferenced this file. Notice the discrepancies in the georeferencing between the historical map and the OSM basemaps. Where are they?
  13. Add Raster: Load the page from 1883 Robinson Atlas of New Orleans. Note: I have already georeferenced this file.
  14. Create a point shapefile called “points_interest’. In that file you will use points to locate buildings you think have disappeared. [HINT: for more convenient viewing, download the Norman and Robinson maps from Blackboard and view them in a separate image viewer]
  15. Build an attribute table for these points, with these attributes
    • Name
    • Year [will be the same as the map]
  16. Edit the new shapefile
    • Add 4 points from the 1854 Norman Map
    • Add 2 points from the 1883 Robinson Atlas page
    • Change “properties” to display the new name and date info
  17. Create a line shapefile for roads and an attribute table with these fields
    • Name
    • Year
  18. Trace 4 roads from the Norman map and them to compare to modern roads
  19. Create a new polygon shapefile with “building_name” and “year” attributes
    • Trace 2 buildings as polygons, assisted by the ‘snapping’ function
  20. Save the whole project as a “NOLA.qgs” file so you can load it later.
  21. Zoom in on downtown New Orleans with a view that shows your new vector files but NOT the historical maps.
  22. Open Print Composer; then Layout, then Add Map to show this downtown area. Leave enough space at the top or bottom of the page for your title
  23. Go back to the main screen of QGIS, Zoom out to show the full extent of Louisiana. Turn off the buildings and roads areas [to speed up loading]
  24. Then back in Print Composer, add an insert map [Layout/Add Map] that shows the whole state.
    • Put frames around both Map0 and Map1
    • Add a scalebar in Map0, with units in feet [Layout/Add Scalebar]
    • Add a Title to the map [Layout/AddLabel] and add another smaller label identifying the sources of the data.
  25. Save the printer composer file and then export a PDF[Composer/Export as PDF]. Put your last name in the PDF filename and upload it to Blackboard

Data sources for this tutorial:

  1. Base map of Louisiana/Texas, etc. from http://NaturalEarthData.com [cultural vectors];
  2. Base map showing many specific features of New Orleans https://data.nola.gov/
  3. Detailed base map of city and surrounding area; http://www.Mapzen.com — features metro extracts of OpenStreetMap [OSM]
  4. Benjamin Norman, Norman’s Plan of New Orleans & Environs [New Orleans?, 1854]. https://www.loc.gov/item/2012593335/
  5. Elisha Robinson, Atlas of the Citiy of New Orleans, Louisiana, based upon surveys furnished by John F. Braun. New York: E. Robinson, 1883. http://www.orleanscivilclerk.com/robinson/guide.htm

 

Barbados in QGIS: A Follow-up to the Programming Historian Tutorial on Adding Layers

This tutorial is designed so you can practice the skills you used in the Programming Historian QGIS Tutorial about adding layers

  1. Make a folder or directory called “Barbados” on your computer.
  2. Download the following Barbados data sets from DIVA-GIS [Google it] into that directory and unzip them; each should be in its own sub-directory.
    • Administrative Areas BRB_adm.ZIP
    • Roads BRB_rds.ZIP
  3. Open QGIS and set up up a new project.
  4. Set up CRS (Coordinate Reference System) so that the project is using the Barbados 1938 Geographic Coordinate system.
  5. Build a base map: Open these vectors, then change the way they look using the “properties”
    • BRB_adm0.shp; change so there is no color fill. Remember “fill style” = “no brush”
    • BRB_adm1.shp; same as above
    • BRB_roads.shp; change the color and width of the lines so they are easier to see
  6. Look at the attribute table of BRB_adm1.shp. These show the country’s 10 parishes. Note which one of the columns gives the name of the parish. Write down the name of that column. Close the attribute table. Go into the “properties” for BRB_adm1.shp into “labels”. Change so that your map shows the names of the parishes in a large font.
  7. Go to Blackboard and from the Barbados tutorial area, download the file named Dominia-angolorum-BarbadosTIF.zip. Unzip it and import the .tif file into QGIS as a raster file. Note: I have already geo-referenced this file.
  8. Go back to BRB_adm0.shp and BRB_adm1.shp and change the width of the lines so they are visible.
  9. In the left-hand “layers” panel, drag the Dominia-angolorum … layer so you can see the parish lines over the historical map.
  10. Go back to Blackboard and download the file named Thompson_Barbados_1817.tif. Import that into QGIS. [Note: I have already geo-referenced this file.]
  11. Save your work. Close QGIS

Data Sources for this Tutorial

Country GIS base map data

http://www.diva-gis.org/gdata

Historical maps

The map “Dominia anglorum in præcipuis insulis Americæ ut sunt insula” can be downloaded aat https://www.loc.gov/item/74690902/

Other sites that are likely to have similar maps are:
* http://DavidRumsey.com
* The John Carter Brown Library Map Collection

© 2017 John Garrigus

Theme by Anders NorenUp ↑

css.php