QGIS Introduction Exercise: Zombie Apocalypse

This exercise is designed to instruct you in using QGIS – an open-source GIS software platform which is gaining popularity in the professional world.

In this exercise you will learn how to:

  • Download GIS source files
  • Perform basic functions within QGIS
  • Create and edit shapefiles and their attributes
  • Clip layer attributes using other layers
  • Install and use QGIS plugins
  • Import Google Maps imagery
  • Create a home area buffer map for use in case of a zombie apocalypse

Some helpful introductory materials for QGIS:

The official QGIS Training Manual:

QGIS – For Absolute Beginners:

Introduction to QGIS:

Data management:

In this exercise as in any exercise, data management is crucial to your success. Before starting this exercise create a folder in your named folder on the D: drive titled “QGIS Zombie Lab”. This is where you will be storing the data for this lab.

Data files needed in this lab exercise can be obtained from the Maine Office of GIS at They are as follows:

  • County Boundaries
  • Town Boundaries
  • Cemeteries

Click the green icon for shapefiles (see legend at top of webpage) and your download will start. Once the files have finished downloading, extract them using PeaZip to separate folders titled “Cemeteries”, “Maine Counties”, and “Maine Towns” within your “QGIS Zombie Lab” folder on the D: drive.

Starting the Exercise:

Now the fun begins – we can open QGIS!

  1. Upon opening QGIS, you may be greeted by “recent project” files on the working area (formally called the canvas). Don’t touch these! They are other student’s work.
  2. On the left hand side of the page is the browser panel. This is where all of your files can be accessed within QGIS.
  3. Within the file directory in the browser panel, navigate to your folders in the QGIS Zombie Lab folder you created earlier. Clicking the small [+] symbol next to each folder will show you its contents.
  4. Within each of your subfolders in the Zombie Lab folder, you will see .shp files. Right click on “county.shp” under the Maine Counties folder and select “Add Layer”. You should see the shape of Maine appear on your canvas with the counties outlined.
  5. In a similar manner as above, add “Metwp24P_Dissolve.shp” within your Maine Towns folder as a layer too.You should see all of the towns in Maine appear over the counties.
  6. Turn off the visibility of the Towns layer by clicking the black [X] next to that layer in the Layers Panel, found beneath the browser panel.

Editing Layers and Shapefiles:

Because you’re a student at UMaine, during the school year you live in Penobscot County. We’ll be focusing on that county for the remainder of the lab, so let’s edit the “county” layer to include just Penobscot county.

  1. Right-click the county layer in the Layers Panel and select “Open Attribute Table” from the dropdown. You should see a new window open with every feature in the county layer listed in it.
  2. At the top of the table window, click “Select/filter features using form” or simply use the keyboard command Ctrl+F. This is a filtering feature which allows us to select specific parts of a layer based on the attribute data associated with each feature.
  3. In the “COUNTY” text field type “Penobscot”.
  4. Next to the “COUNTY” field, leave the case-sensitive checkbox unchecked and click the button next to it. In the dropdown, select “Not equal to”.
  5. At the bottom of the window, click the “Select features” button and close the table window. You will notice all of the counties are highlighted other than Penobscot county.
  6. At the top of the window in one of the toolbars, you’ll notice a button that looks like a yellow pencil. This is the “toggle editing” button. Click it, and you’ll notice the outline of each feature you selected in the previous step is outlined in red.
  7. Hit the delete key on your keyboard. You’ll notice all of the features other than Penobscot County have been deleted from the layer.
  8. Now is a good time to save both the layer and your project. To save the layer, right-click the layer in the Layer panel and select “Save as” from the dropdown menu. In the resulting dialog box, choose ESRI Shapefile (option found in the Format dropdown list)and browse to your Maine Counties folder and name the file “Penobscot”. Click OK to save the pathname and then click OK in the dialog box to save the file.

To save your project, follow this path from the toolbar at the top of the window: Project>Save as… In the resulting dialog box, name your file with your first two initials followed by “Zombie 1a”. Ex: “JS Zombie 1a”.

  1. You’ll notice the Penobscot layer has appeared in your layers panel. You can remove the “county” layer now by right-clicking it and selecting “Remove”. A dialog box will open asking if you wish to save it. Select No (you don’t want to edit the original county file with your changes). Another dialog box will ask if you wish to remove 1 legend entry. Click OK.

Clipping Features with Features from other Layers

Now that we have just the Penobscot layer, we need to cut the Town layer with the Penobscot layer as a template in order to obtain just the towns within Penobscot County.

  1. Move the Penobscot Layer above the Town layer by clicking and holding the Penobscot layer in the Layers panel and moving it above the Town layer in the tree.
  2. Turn on the visibility of the Town layer. You should notice the Penobscot layer is visible over the Township layer.
  3. Select the Town layer by clicking it once in the Layers Panel. Make it editable.
  4. Follow this path from the toolbar at the top of the window: Vector>Geoprocessing Tools>Clip.
  5. In the dialog box, select your input layer as “Metwp24P_Dissolve” and your clip layer as “Penobscot”. Select Run at the bottom of the window.
  6. You will now have a layer named “Clipped” in your Layers Panel. Save it as “Towns” in your Maine Towns folder. An error box will appear – simply hit OK.
  7. Remove the “Metwp24P_Dissolve”, “Clipped”, and “Penobscot” layers from your Layer panel and add the Towns.shp file as a layer.
  8. Add “cemeteries.shp” as a layer from your Cemeteries folder.
  9. Make the cemeteries layer editable.
  10. Follow this path from the toolbar at the top of the window: Vector>Geoprocessing Tools>Clip
  11. In the dialog box, select your input layer as “cemeteries” and your clip layer as “Towns”.
  12. Save the new “Clipped” layer as “Active sites” in your Cemeteries folder and remove the clipped and cemeteries layers from your Layer panel.

Importing Google Imagery

  1. Utilizing the OpenLayers plugin (path: Web>OpenLayers plugin) open Google Hybrid. If you do not have this plugin, go to the Plugins tab in the toolbar at the top of the window. Click “Manage and Install Plugins…” and then search for “OpenLayers Plugin”. Install it, and you’ll be able to use it.
  2. The Google Hybrid Layer should appear on top of all of your layers. If it isn’t, drag it to the top of the tree.

Creating a Shapefile layer and Adding Features

  1. On the left hand side of the screen, click the “New Shapefile Layer” button.
  2. In the resulting dialog box, select the “Select CRS” button next to the project dropdown. In the Filter textbox, type “NAD83 UTM Zone 19N” and select NAD83/UTM Zone 19N from the options displayed.
  3. Back in the dialog box you can now select UTM Zone 19N from the projection list. Do so now.
  4. In the New Field area, input “Location” into the Name textbox. Set the type as Text Data and set the length to 10. Click Add to Fields List.
  5. Select the “id” field and click “Remove Field”.
  1. Click OK and save the shapefile layer as “Home” in your Zombie Lab folder on the D: drive.
  2. Turn off the Active Sites and Towns layers and make the Home layer editable.
  3. Zoom to where your Maine address is using the zoom tool .
  4. Add a point in the center of your home building by using the Add Feature button. A dialog box will open, type “Home” and click OK.
  5. Make your Home layer un-editable. The program will ask if you wish to save changes. Accept.
  6. Select your Home point using the Select Features tool .

Adding Buffers around Points

Now that we have your home location entered as a point on the map, we can create several buffers around it for threat levels of zombies based on proximity to your home. Let’s do that.

  1. Follow this path to get to the buffer tool: Vector>Geoprocessing tools>Fixed distance buffer.
  2. Select the input layer as Home and set the distance to 3218. This setting is in meters, so this is approximately two miles. Set the segment number to 50, and click Run.

  1. Save this buffer layer as “Low Threat” in your Zombie Lab folder, as this is the largest buffer distance you’ll have on your map.
  2. Repeat steps 1 & 2 using a distance of 1609 (approximately 1 mile). Save this layer as “Medium Threat” in your Zombie Lab folder.
  3. Repeat Steps 1 & 2 using a distance of 805 (approximately 0.5 mile). Save this layer as “High Threat” in your Zombie Lab folder.
  4. Remove all layers called “Buffer” from your Layers panel.
  5. Adjust the colors of your buffers to match the image in Step 8 by right clicking each layer, clicking properties, navigating to Style in the dialog box, changing the Fill color, then clicking OK. Example dialog box below.
  6. Make each layer semi-transparent by right clicking on the layer, selecting properties, selecting Style, and moving the transparency slider to 75%. Click OK.
  7. Move the Home layer to the top of the tree, with Active Sites directly below it.

The Final Steps: Creating Layouts

  1. You may wish to change the properties and appearance of your features for your layouts. Explore changing appearances if you wish, but it is not required (though it may boost your grade if you explore new things not outlined in this lab exercise).
  2. To create layouts in QGIS, one must click the “New Printer Composer” button . After clicking, a Composer Title dialog box will pop up. Name your layout whatever you want (ex. Zombie Output).
  3. All of the tools necessary to create a proper map (legend, map, north arrow, etc) can all be found in the tool bar on the left of the composer window.