Level 2 MIT Exercises
Level 2 MIT Exercises
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.
• 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.
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.
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.
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.
5. Close the Weighs File Creation window and Weights Manager window.
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
For information about citing these materials or our Terms of Use, visit:
https://ocw.mit.edu/terms