2.2. To be handed in

Introduction

One of the most useful features of QGIS (or any GIS platform) is the ability to integrate data acquired with a GPS machine onto a map for visualization or analysis. This is often useful for mapping specific types of terrain or other geographic or geological features. For example, you might take a GPS machine into a mapped plot of land known to contain a particular rare plant species, then use the GPS to locate the general location of instances of where you found that rare plant in that forest, and, upon returning to a computer, be able to input the locations of that plant onto a pre-scanned map. Alternatively, you might use it to create a map of a previously unmapped area by walking with the GPS machine along a trail, then importing that trail information onto a computer map with QGIS. This has important applications for mapping very specific types of geographic data, particularly data that might not be included on a standard map.

Of course, not everyone has a GPS machine, but this assignment will give you an opportunity to explore how the process of integrating GPS data works in QGIS. We will be using GPX data taken by mountain-biking enthusiasts of biking routes and interesting points along those routes for the Foxboro state forest reserve in Foxborough, Massachusetts, USA.

Note: All images below were taken from screenshots on computer running Microsoft Windows. Linux and Mac images will look different.

Getting Started

There are many companies that sell GPS machines. As is often the case, many of them code their data in proprietary formats that are not often readable across different platforms. Obviously, this lack of usable formating creates some problems if you want to be able to share GPS data with a variety of people.

To solve this problem, independent developers have created the gpx data format, which is open-standard, and can be read by anyone. In otherwords, your GPS machine may save data in its own particular propietary format, but that data can be converted to the open-standards GPX format which can be read by anyone.

Obtain the GPX point file

You will need to download several data sets in order to complete this assignment. The first is the GPX point layer itself. It was created by a mountain biker named Dan Foster, who took a GPS machine with him on a biking trek through the forest, and plotted his journey by both marking trails and by taking specific points of interest. You can download the file here. Take some time to read the information on that page. He lists the various points he took, as well as some other information. To get the actual file, click the link that says "Download" at the top of the page. Note that the page indicates that the file can be uploaded to a GPS machine that other bikers could take with them and follow the trail. Obviously we'll be using it for a different purpose--to map the points and layers in QGIS!

Obtain the Massachusetts towns vector layer

To situate these points in QGIS, we'll download the towns layer from MassGIS. This will give us the outlines of all of the towns in the state of Massachusetts and allow us to see where the GPS points are located within the state.

To obtain this file, go to the Mass GIS website and the section on which you can obtain the town boundaries layer: http://www.mass.gov/mgis/towns.htm. Click the link for the ESRI shapefile of the TOWNS_POLY and TOWNS_ARC.

The file you are downloading is a self-extracting zip-file. If you are using windows, you can simply double click the file and follow the instructions to extract it to your working directory (wherever that may be on your computer). If you are running linux, you will need to use cabextract, which is available as a package on many linux distributions, or can be compiled from source.

Obtain a scanned topographic map of foxboro state forest

Finally, we're going to download a topographic map of Foxboro state forest, so that you can see some of the geographic features associated with this bike trail. MassGIS makes sections of topographic maps available for download along with its other GIS data. Information about the available topographic maps is available on the MassGIS website here. To download the appropriate file, you will need the topographic maps images reference, which is available as a pdf here. The easiest way to find foxboro is to use your PDF search tool (the binoculars icon) and search for the word "Foxboro". One instance should be highlighted, but you'll see that it crosses between two topo quad numbers. For the purposes of this assignment, you'll want the westernmost quad, which is available for download here, here, and here. As you've already learned, the individual TIFF file does not contain all of the information necessary to display it in QGIS, and thus you'll need the TFW and the AUX file as well--make sure you download all three.

Putting the data into QGIS

Now you're going to create your map. I'll leave it up to you to know the exact mechanics to put this data into QGIS, but I will suggest that you do them in the following order:

  • 1 Set your projection information to "NAD83/Massachusetts Mainland" and enable projection "on the fly"

  • 2 Import the TOWNS_POLY.shp file (vector layer)

  • 3 Import the GPX data of the biking trail

Note: To do this, you'll need to enable the "GPS Tools" plugin. In QGIS,

click on the "Plugin" menu, and select "Plugin Manager". You should see

a list appear of various plugins that QGIS has available. Check the box

next to "GPS tools", and click "Okay". Now when you open the "plugin" menu,

you should see a slot for a new menu called "GPS". In that menu, select

"GPS "Tools", and you should see a dialog box that looks like this:

        

Now all you have to do is click the "..." button next to "file" and 

navigate to where you saved the GPX file (foxboro.gpx) that you 

downloaded previously. Once you've done that, click "okay", you

should see a cluster of points appear on your Massachusetts towns map!

        

  • 4 Import the Topo Quad (raster layer)

  • 5 Set the projection information for the topo quad (NAD83/Massachusetts Mainland)

  • 6 Clean up the data so it's easily viewable (more on this below as well)

Note: It's up to you how you want your map to look, but here are some

suggestions to make it easier to see the GPS data and the topo map

together. First, drag the topo map layer to just above the "TOWNS_POLY"

layer. This will put the map underneath the GPX points. 
  
        
Secondly, right-click the "Foxboro, tracks" layer, and select properties.

Change the "Outline width" from 1 to 3, and change the "outline color" to

bright red. This should make the track much more visible on the topo map.

        
Thirdly, right-click on the "TOWNS_POLY" layer and select properties.

Change the fill color from whatever it is to white.

        
Finally, right-click on the topo quad layer in the legend, and select

"Zoom to layer extent". At this point, if you've done everything correctly,

your screen should look like this:

        

Take a screenshot of this map, or you can save the map as a file by going to "File"=> "save as image". Call the file "yourname_map", and put your name, without spaces. Make sure to select PNG as the file format. Then click okay, and the first part of the assignment is done!

Adding Points

As you can see, there are dots that represent GPS po?nts, and a red line that represents a trail. These correspond to the path that the biker took, as well as specific points of interest that he noted with his GPS machine. If you highlight the "Foxboro, waypoints" layer in the legend, then use the "Identify features" tool:

by clicking on any of the points, you can read the information that was recorded by the biker at that particular point. For example, if you click the point located on the "G" in the words "High Rock" on the topo map, you should see the following:

Add a point to this layer that marks the location of the State police station. Do this by selecting the "Foxboro, waypoints" layer in the legend, then click "start editing", and "Capture Point". In the "enter attribute values" dialog that appears, name this point "POLICE" and enter a description that says "This is the state police station nearest the Foxboro state forest". If you know how to read topographic maps, you can also enter the elevation (hint: the contour interval is 3 meters), but this is not necessary for the assignment. This would be a good thing for a biker to know on a trail, since you never know when you'll need some help!

Another way to see the information about the particular points is in the attribute table. Open it and scroll to the bottom, where you'll see the point you just added marking the Police Station.

Note the "description" column of the points. They are a little bit easier to see if you click on them with the identify tool, but the author did provide useful information for nearly every point. If you stretch the rows and columns a little, you can see his descriptions more completely.

Final Questions

Send answers to these with your map image.

  • 1)How many points did the biker take in total (not counting the one we added for the police station)?

  • 2)List the X and Y coordinates, within 100 meters, of the State police station point that you created.

  • 3)What is the name of the object at point #23, and why did the biker give it that name?

  • 4)What landmark sits at the point immediately to the west of the "S" in "State Forest" on the map?

  • 5)Zoom out to view the full extent of the "TOWNS_POLY" layer. Using the identify tool, list the population of the town of Foxborough (where our points are contained) in 1990. (Hint: The attribute with this information is called POP1990).

Good luck!