In the previous labs we have looked at how separate layers can be investigated and represented by queries and presentation of differing attributes. We have seen how different layers can be related to each other visually and today we will practice some GIS overlays to model different layers together. As usual you should create a directory for your work. This should be in your geog204 directory and call it lab4. The data sets for this lab are in n:gislabsgeog204tutlab4. Here you will see a multitude of available layers.
Working in Google Earth
By now it should be second nature to open QGIS and load data into a project. Today however we are going to start in Google Earth. In the last tutorial we selected out the Census Tracts for the city centre of PG, saved them as a KML file and brought it into Google Earth. Today we are going the opposite way.
Open up Google Earth and zoom to the University and the surrounding area. Turn on the “Places” layer in the bottom frame of Google Earths table of contents. Zoom to a level whereby you can see the churches along Westwood drive. If you remember you can create your own directory tree in Google Earth. We are going to create folder to hold point data and then bring the data into QGIS by doing the following:
- Create a folder under temporary places called churches.
- Now right click on each church individually and select copy
- Go to the churches folder, right click select paste
- Once all three have been selected
- Save place as
- Save as a KML file called churches.kml in your newly created lab 4 directory
- Open the layer in QGIS
Checking distance within Google Earth
See if you can figure out how to calculate the distance in Kilometres from the centre point outside the cafeteria to the closest and farthest churches on Ospika (as the crow flies).
Question 1: Determine the approximate distance to the church on Ospika by road. Write down the steps you did to perform this query.
Viewing your KML data in QGIS
See if you can figure out how to bring in this KML file into QGIS. Once you have done so load the roads layer in the /home/labs/geog204/tutlab4/google_earth_layers directory. You can see that your points should line up in the right place
Interesting piece of information
With your kml layer in the project, check out the attribute table. Expand the description field as far as you can. Notice that this is a very long entry!! We will come back to this later on with a shape file version of the same file. Remove all the layers in your project before we go to the next step.
Set Project properties for the next set of layers
After removing all the layers in your project for the churches, we will make sure there is no issues with layer projections (we will be going over projections in tutorial next week) by:
- Going to Project –> Project properties –> CRS –> turn off “Enable on the fly CRS transformatoins”
Spatial relationships between layers in QGIS
Go to the tutlab4 directory for the geog204 labs and open the shape files that are in that directory (but not the directories under it).
Looking closer at the data
Set up your view in a way that it is easy to see as much information as possible. Have a quick look at the differences between where the dabc,eabc and the pgbound line up.
- Do all three line up – do any line up? (does this discrepancy ring a bell). We will be going over this more in the lab next week as well).
- Does it look like we can compare the spatial information (boundaries) from Enumeration Areas with the Dissemination Areas (Does it work in some areas)?
- We cannot determine which layer may be in the proper location without any meta data (i.e. *.meta files), but you can see that the pgbound and the roads data seem to line well together.
- What do the units of measurement do these layers seem to be in? (Map units). Remember this for later on!!
You should have some ugly scene like this:
Fig 1: Image zoomed into PG
We want to find out the street that the hospital is on. We are going to do this by creating a line layer to use below: (IMPORTANT – When you create your line layer, put in 26910 into the search line and select it as the CRS to use).
- Draw a line on a new line layer (perhaps linetrace.shp) that follows the road the hospital is on for a fair distance
- Buffer that line at 100 metres to create a new linetracebuf.shp layer
- Use the select by location to see which points in the roadname layer intersect (in this case are within) this new buffered layer
- Check the results of the selection in the attribute table of the roadname layer and see which value is repeated
- Is there more than one way to find intersecting features between layers
Question 2: Write down the steps you did to get the name of the street the hospital is on. How could you get the same results without having to digitize a line along the road?
Question 3 Does the road layers appear to be clean and built. Do the line sections overlap like spaghetti data? What does the attribute table tell you about clean/built data and whether it follows the old topological model?
Exercise 2 – Spatial Overlays or GeoProcessing:
Here are some graphical examples taken ESRI documentation of what we are going to do in the following sections. Theses illustrations are pretty old – where might you find more recent drawings (again remember links from the tutorial and lectures)?
Fig 2: Overlay Examples
First we are going to reduce our study area to include only the areas within the city limits of Prince George. By using google (and the above illustrations) look up what a “CLIP” overlay does. Remember you need to have a polygon layer to clip with. The pgbound layer is a line layer however! What did we do before to make a line layer a polygon layer (we built a line layer into a polygon layer)? Try to see if you remember how to do it.
You will see (as we experienced before) that there is a difference between a polygon layer built with the linetopolygon function under the vector tool box and the polygonizer (do we remember why that is?). Scott has created a pgboundpoly layer in the builtpolygons directory in tutlab4 (in case you have difficulty building a polygon shape file from pgbound. Load the pgboundpoly layer into your project and clip out the dabc and hospital layers to dapg and hospitalpg layers.
Exercise 3: Buffering and intersecting
Buffer the hospitalpg layer at 1.5 Kilometres and intersect it with the dapg layer – we will call the buffered area a medical service zone (ie: pgmed.shp), and the resultant intersected layer dapgmed.shp.
Question 4: Write down the steps you just did to get the dapgmed layer.
Question 5: What is the approximate ratio of area covered by the new medical services zone compared to the original area of the DA unit numbered 59530065? You can approximate by eyeballing the two polygons, but you can also get more information from the attribute tables and information button (BUT be careful what attributes you look at).
If we wanted to add a buffer of the hospital to this combined unit at 0.75 Kilometres (to remove data from the medical services zone within that distance of the hospital – create a dough nut), what geoprocessing tool would we use? Lets perform the tasks. (Hint look at the last example in figure 2b – but it is called a different name).