Setup as usual – map drives to be able to use our lab data
Every week we have to re-mount our k and L drives to the student lab machines. This sucks, but it is just the way it is. We will not use osmotar for the whole tutorial (as Google Earth does not work well on remote servers)
As a reminder – the method to mount drives is:
1.) Open the command shell by typing “cmd” at the start menu – and start it
2.) type the following command for drive k (remember to substitute your actual user name for ‘username’:
– net use k: \\gisfs2.unbc.ca\yourusername /persistent:YES
3.) type the following command for drive L
net use L: \\gisfs2.unbc.ca\gisfolders /persistent:YES
Cartography – not a big part of Geog 204
In this class, we have not paid much attention to cartography and many of the topics associated with it. For our projects we will have to make maps of course as well as learning how to incorporate data from QGIS into layout into a web page, a word document or a pdf file. We played around with map composers in QGIS, but unless you took Geog 205, you will not be aware of cartographic conventions\practices. We will go over some of these principles in upcoming tutorials.
we have to know something about them (even if we make ugly maps)
Another cartographic principle that we have not discussed in this course is map projections. Map projections are a method by which map content can be transposed from the spherical world to flat two dimensional maps. There are many projection techniques that have been created and developing for hundreds of years.
You may be finding that with your project you are coming across data that does not have x and y positions in Latitude and Longitude, but other data layers do. For instance the road data we used in lab2 is not in geographic projection (lat long) but the same layer is for lab4. In this tutorial we are not going to discuss the theory of projections too deeply, but we are going to get an idea as to how it works.
For more information on map projections – hit the web. Here are a couple of places to start:
Using Projections in QGIS
Open up QGIS and:
– File –> project properties –> Coordinate Reference System (CRS) –> click off “enable on the fly transformations”
– Settings –> Options -> CRS tab –> Don’t enable on the fly reprojection
– load the pgbound layer in the tutlab3 directory into a project (Just click OK for the CRS panel as we have done before).
From your experience, what is the projection of this layer? This is one of the standard projections (or better yet – non projections) that data sources such Stats Can uses.
Now load a second layer:
– load up the roads layer from the tutlab2 directory.
If you zoom to the extents of the overall view, what do you see? If you zoom to each layer individually, what do you see? Are the units of each layer the same?
Leave QGIS for an instant. Take a look a the folders where the two data layers came from. They are both shapefiles, but they have different number of files associated with the layer (not just the three necessary files). What is the extra file the roads layers has. Look at it in a text edior (i.e. gedit) what information is in that file?
Create a directory in your geog204 directory called projtutorial.
Now back in QIGS we want to save the pgbound layer to the same projection as the roads layer. Any ideas how we would do this? It is a very common sense answer actually.
When you load a layer into QGIS that does not have its projection defined, you can tell the software what it is (in out case we should have WGS 84 – 4326). You can confirm and/or set the projection you are using (or in this case – no projection), by right clicking and set the CRS.
Try to save this layer to you own directory in the same projection as the pgbound layer. What is the projection of the pgbound layer?? Find the projection (HINT: try both the properties of the layer and pretend to save it to get the save as panel). Once you have figured it out, save the layer and reload it into your project. How do the layers line up now?
On the fly projection
You can play around with having on the fly projection set for your QGIS projects. CAREFULL to make sure that you know the projection the data you are working with is in and how to manage those layer.
Go the the web page for projection information for WGS 84 at http://spatialreference.org/ref/epsg/4326/
If give a description of this code. Open another tab and find out what EPSG is an acronym for. Is this a standards agency? How do the currently operate?
Now look up the value 32610 in the search panel at spatialreference.org – does this make sense as a projection for where Prince George is? You notice there is a list of files used to describe this projection depending on software and standards. What file would be used with shape files that QGIS can use to determine its projection? Is there one for the roads layer? Does it match the one at spatialreference.org?
Try 32710 – what is that projection?
Look up UTM zone 1oN (the zone much of BC falls into). Of the values found – do any fit the roads projection. Which on the list would be one supported by Natural Resources Canada (NRCan)? We looked at this in the accuracy and precision lecture.
Try 900913 -what is it? Why was Google so instant that they have their own projection labeled by the EPSG as this number?
What does EPSG stand for? Check out EPSG
Move Layers into Google Earth
What projection does Google Earth use? Do a Google search to find out. Does it use the same projection as Google Maps (HINT: it is called pseudo mercator – or Google Web Mercator)? Now try to save the roads layer as a KML with the projection you found for Google Maps . Open the file in Google Earth. Now load the pgboud layer from the labs directory that you have in your project (from the tutlab3 directory). Save this file as a KML (without changing the projection), and load it to Google Earth as well. How do the layer line up? Did you have to change the projection when you saved it?
Move Layers from Google Earth
In Google Earth, make a polygon layer and bring it into QGIS. Zoom to this layer, what projection is it in? This projection information is a bit confusing when using Google Earth, but you can see that for moving data into Google Earth you can get away with using a variety of projections (even the UTM Zone 10 projection the roads are in) – but when bringing data out, it is in WGS84 (EPSG – 4326).
Using data in your projects
You may find it somewhat difficult to bring data into QGIS without a greater understanding of projections, but Scott and Aita can help out. Most data we are using in British Columbia however is in WGS84 (or something Lat/Lon), UTM projections or in BC Albers (see if you can look up the EPSG code for that one).