Solving a Problem
We have been working toward gaining some understanding of the many aspects of spatial data, and how descriptive information can be linked to these geographical entities. Today we are going to take a break from GIS theory and concentrate on GIS applications. This is where we start to think about the mechanics of applying GIS tools towards your project ideas. In lecture it was mentioned that your projects should be laid out similar to that of a research journal. It is not important what journal you use as a template, as many are laid out in a similar fashion. We will discuss a typical journal layout in a future tutorial. This lab will not be as involved as your project but it brings together what you have learned so far to aid you in forming an idea of how to approach your project.
The first thing you need to do is review what others have investigated in regards to your topic (or get an idea as to what you may be interested in). This does not suppose that you have already determined your line of investigation but rather is intended to give you direction. It may be wise to look to google to get a quick idea of possible concepts. For instance look to google to search out: GIS and: medical, public health, or heath.
Question 1). Who is Dr. John Snow and what contribution did he do towards epidemiology and illustrating GIS before its modern digital use.
Now do a lit search through articles in the library for an article by Timothy Nyerges about GIS and society. Note the authors and publication date in your answer (both searches necessary for question 1).
Devising a model
We will work with Stats Can data to test a simple theory of how well distributed hospital locations are in regards to preconceived medical notions. We are going to assume that we have done our background research (lit review) and we are going to build a model based on population descriptors expressed spatially. We are going to look at the distribution of people within parcels of B.C. We then will look at the distribution of hospitals in these areas.
Lets open up QGIS. For todays lab, adjust some settings in the software:
Now load up three data sets located in the same place as the lab materials for the other geog204 labs:
All the layers are in WGS 84 (the default when you load them). Arrange your layer manager (theme manager) so that both layers are visible.
Question 2). What is DA an acronym for? What parts are combined to record a DA as a geographic code? Provide an example code for a DA in Prince George?
We can aggregate individual DA units into larger community based conglomerates (such as Fraser Fort George Regional District) to determine the population ratios hospitals have to support by using several methods. Today we are going to use the table joins and thematic maps. In the next tutorial we use methods that may be more difficult but very useful to know.
Before we aggregate data, review the table for the dabc layer. What are the items in this table? Do they have some meaning to you? Can you determine which of the data set has a unique identifier and what it is? Can you determine if this identifier is a character (text type) type or numeric type (by looking to see which side of the cell the values are aligned with)? If you chose the “DAUID” as the unique ID based on your knowledge of Stats Can geography naming – does it work as a UID in a GIS table (are all the values unique)?
Zoom into Prince George. Use the information button or the select feature tool – and click on a DA unit in the city.
Question 3). If some of the values are not unique for DAUIDs – why is that? Why are there ‘NULL’ values for DAUID and other attributes? Based on the Dauid value, determine the Census Division value for Prince George. From this answer, explain how to aggregate all the DA units into a Census Division (CD) based on the Dauid (the concepts not the QGIS commands).
We need to use the query functions in the attribute table for the “dabc” layer. Aita or Scott will illustrate – as you have not queried in QGIS before. There are some helpful hints for this such as:
Save this newly created subset (the Fraser Fort George CD) as a new shape file in your lab3 directory. You have created a lab3 directory – right?
Fuel for the model – attribute data
Searching the Stats Can Web site – We looked at the census analyzer in the last tutorial
We download data in tutorial (for the Fraser Fort George Regional District) through the use of the census analyzer in tutorial last week. You can practice this now if you wish. For today’s lab we will use the data Scott has provided in the next section.
For this lab we will use all of statistics for B.C. to match to the new Fraser Fort George CD we just created. Can we do this – the table from Stats Can will have many more records (rows) than the attribute table for the CD layer?
Stats Can Boundary file and attribute data into QGIS
Download a Boundary file for the lab from Stats Can.
There are many pages on the Stats Can site, and navigation to find specific data can be a bit daunting. It is easy to find a link to the Boundary files by just doing a google search for them. We are interested in:
Once you download the data (a compressed zip file) into your lab3 folder:
Zoom back into the area around PG. Notice the difference between the shapes of the polygons between the layer you loaded from the lab folder to the new file you have downloaded.
Subset the BC DA polygons
The data Scott has gathered for the section below is for BC only. With this in mind, we should create a new shapefile from downloaded dataset that has only the BC polygons.
We are not going to tell you how to do this – as this action is very similar to the steps you took to perform the extraction of the Fraser Fort George polygons above.
Joining census values to boundary files
To keep us all on the same page, we will use the data Scott has prepared (he has made a non-spatial *.csv file for importing into QGIS). This file was downloaded and cleaned in the same manner as we did in the tutorial.
Add the table census_2006_da_bc.csv from the tutlab3 directory into your project, and join the two tables together (your new CD layer and the CSV file) in the following manner:
Calculate population density
Once you have joined the data together – open the data and observer that some of the “pop” values are “NULL”. Why is that? There are two possible answers that Scott can think of. You may want to remove the records (rows) that have NULL values in them. Do you remember how to edit a layer? Aita or Scott will show you how to remove these records – but take some notes!
Now that you have population values calculate the population density of the polygons in square kilometres by:
You can stops and save you edits.
Export your results to Google Earth
Style your Census Division values
As you did in the first lab, style your bc DA layers using the “catatgorized” with your population field as the field to classify with. Here is a quick reminder as to how to do this:
The Image below illustrates the layout of the style
This is really not a good looking map, but it will work for what we need to do today. A better map would be to use the graduated styling method using the population values – this will be part of the final question at the end of this section.
Export the data to Google Earth
You can export data to Google Earth (KML file) at any time using the right click –> save as method – BUT this method does not save the styling for polygons. We are going to use another plugin to get the styling as well.
Plugins: Add the plugin mmqgis to your project
Here are the steps to export the map to Google Earth
Now Open up Google Earth and load the KML file into it
Final Questions – map output worth 2 marks:
This assignment will be started in the lab today, but finished as part of the tutorial on Friday.
We are going to create a second kml to be used in Google Earth that illustrates the variety of values for population values or population densities values. We will follow this general plan:
Clean up of your work today
As we do not need all the data we downloaded today, lets delete some files.