0% found this document useful (0 votes)
88 views

Level 2 MIT Exercises

This document provides instructions for a QGIS workshop focusing on map projections, basic analysis tools, raster tools, and spatial statistics tools. The exercises demonstrate how to examine and change map projections, use buffer and contour tools, and perform a local Moran's I analysis in Geoda to identify clusters of high and low values. Spatial analysis requires understanding projections and how to ensure data layers match before analysis. The document guides working with both vector and raster data in QGIS and Geoda.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

Level 2 MIT Exercises

This document provides instructions for a QGIS workshop focusing on map projections, basic analysis tools, raster tools, and spatial statistics tools. The exercises demonstrate how to examine and change map projections, use buffer and contour tools, and perform a local Moran's I analysis in Geoda to identify clusters of high and low values. Spatial analysis requires understanding projections and how to ensure data layers match before analysis. The document guides working with both vector and raster data in QGIS and Geoda.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

GIS Level 2: QGIS Workshop Exercises

Exercise 1: Map projections


Map projections, also called Coordinate Reference Systems (CRS) can be viewed or changed using GIS
software.

1. Examine the data in GIS_Level2_Data\workshop_exercise. Is there a projection file for each


dataset?
Note that cambridge_dem is a raster dataset and uses a .tfw file (known as a “world” file), which
contains the information needed to transform image coordinates to real-world coordinates.
Shapefiles use a .prj file, which includes the coordinate system information.
2. Open QGIS. Click Project > Save As and save the new project to your working folder.
3. Add the following two data layers from GIS_Level2_Data\workshop_exercise
a. MBTAbusroutes
b. CambridgePlaygrounds
4. Click Ok when you are asked to select a transformation. Close the Data Source Manager
window.
The transformation box changes the coordinate reference system of your map project (not the
data layers). This changes how the data look on the screen and can help minimize distortion.
5. To add a basemap click Web > QuickMapServices > OSM > OSM Standard.
6. Right click on CambridgePlaygrounds and select Zoom to Layer.
Do the playgrounds and bus routes seem to be in the correct locations?
They should be since both layers had a defined projection (.prj) file.

7. Right click on CambridgePlaygrounds and select Properties.


8. Select the Information tab.
What is the coordinate reference system?

Depending on your version of QGIS, you will either see the name NAD83 / Massachusetts
Mainland (ftUS) or a generic name, such as SOURCECRS. QGIS sometimes has trouble identifying
the names of projections even though the .prj file is being read correctly by the software.
Regardless of the name we can tell it is projected because the Units are in feet.
9. Do the same for the MBTAbusroutes data layer. What is the coordinate reference system? Is it
the same or different from the playgrounds?
10. Close the Properties box and select Vector > Data Management Tools > Reproject Layer.
We will use this tool to change the projection of the playgrounds so that it is the same as that of
the bus routes. Note that when right clicking on a layer there is the option to Set Layer CRS. This
should only be used to assign a projection to a data layer that does not already have one or to

1
change one that is incorrect. Our map projections appear to be correct so we do not need to use
this tool.

Although not always required, your analysis results may be quicker and more accurate if your
data layers are in the same projection. If you want to calculate the proximity of playgrounds to
bus routes, you would first want to make sure the projections of both data layers are the same.

11. Choose playgrounds as the Input layer.


a. In Target CRS, from the dropdown menu select EPSG 26986 -NAD83 / Massachusetts
Mainland_FIPS, the coordinate system of the MBTA bus routes. EPSG numbers are
unique ID numbers assigned to every CRS.
b. Click the … icon next to the [create temporary layer] box and select Save to File. Save
your output dataset in your working folder.
c. Click Run.

Exercise 2: Access basic analysis tools


Tools can be accessed via the menus at the top of the screen in QGIS.

• A number of “core” tools come with QGIS and most can be found under the Vector or Raster
menus. You will also find tools by opening the Processing Toolbox (Processing > Toolbox).
• Since QGIS is an open source GIS software, additional tools have been developed by individuals.
These can be added by clicking Plugins > Manage and Install Plugins and searching for the tool
you want.
• Googling is a good way to find tools that have been created for QGIS. Note that when there is a
major upgrade, some tools may not work immediately.

1. Add MBTA_NODE to the map from GIS_Level2_Data\workshop_exercise.

2. Click Ok if you see a coordinate system message.

3. Click Vector > Geoprocessing Tools > Buffer.

How do you know what inputs and parameters to use? A short description of the tool appears on the
right side of the tool window. Click the help button to learn more about this tool and its parameters.

4. Select the MBTA_NODE as your Input layer from the dropdown menu.

5. Enter a distance of 1000 meters.

6. Most QGIS tools will create a temporary layer unless you specify otherwise. Do this by clicking
the … button next to the box at the bottom of the window that says [Create temporary layer].
Select the Save to File option and choose an output location. Choose .shp as the file type.

7. Run the tool. Turn off your buffers after you have looked at the layer.

The interface for all tools looks similar in QGIS, with most requiring input data, required parameters, and
optional parameters.

2
Exercise 3: Use raster tools
Different tools can be used with raster data versus vector data, although the output could be a vector,
raster, or table, depending on the tools. There are also tools that allow you to convert from one data
type to another.

1. Add the cambridge_dem.tif to your map. Click Ok if you see a coordinate system window. Close
the Data Source Manager window.
2. Click Raster > Extraction > Contour.
3. Select the dem as your Input layer and scroll down to choose an output location in the Contours
box. It’s useful to choose an output name that indicates the contour interval so you can use this
for future reference.
4. In the Interval between contour lines box, type 5. What are the units of this interval? While
some tools default to the unit of the coordinate reference system, QGIS also uses the
measurement unit specified in the project properties. You can find this under Project >
Properties > General. It’s a good idea to set the unit the same as the CRS of your data layers.
5. Click Run. Close the Contour window when the tools is finished running.

You will notice that the output is a vector line layer, which could then be exported to other
programs or used as input for vector analysis tools.

Exercise 4: Use Geoda to access spatial statistics tools


While QGIS includes a wide variety of tools, there are some tools that are not currently included in QGIS,
including those for spatial statistics. We will use another open-source software called Geoda, which was
specifically developed for exploratory analysis and spatial statistics.

1. Open Geoda.

2. Next to the Input file box, click the folder icon and select ESRI shapefile. Select
median_income_suffolk_ma from the workshop data folder.

3. Click the W icon in the toolbar (Weights Manager) and Create. Specify the following:

a) Weights File ID Variable: spatial_id (this is any ID that uniquely identifies each polygon)

b) Rook contiguity (rook shares borders, queen shares borders and vertices/corners)

These parameters tell Geoda how to define a neighborhood for analysis. Feel free to experiment
with other parameters in the future.

4. Click Create and save your weights file.

5. Close the Weighs File Creation window and Weights Manager window.

6. Select Space > Univariate Local Moran’s I.

7. Choose VALUE0 as the variable, which is the median household income in each tract, and verify
that your weights file is listed in the Weights box. See the text file in the workshop exercise data
folder for the attribute field information. Click OK.

3
8. Check off the cluster map and Moran Scatter Plot and click OK.

9. Where are there clusters of high and low income? The tool has also output a scatterplot that
you can examine. Close Geoda when you are finished.

The Moran scatter plot provides a classification of spatial association into four categories,
corresponding to the location of the points in the four quadrants of the plot. These categories are
referred to as High-High, Low-Low, Low-High and High-Low, relative to the mean, which is the center
of the graph. It is important to keep in mind that there is a difference between a location being in a
given quadrant of the plot, and that location being a significant local cluster or spatial outlier.

In the take-home exercise you will learn how to output these results so they can be added to QGIS.
You can learn more about the statistics used in Geoda here:
https://geodacenter.github.io/documentation.html

4
MIT OpenCourseWare
https://ocw.mit.edu

RES.STR-001 Geographic Information System (GIS) Tutorial


IAP 2022

For information about citing these materials or our Terms of Use, visit:
https://ocw.mit.edu/terms

You might also like