← Introduction to GIS Software: QGIS

In-class Excercises

Part 1: Mapping SAT results

  1. Download today's data.
  2. Join the spreadsheet (SAT_Results.csv) to the shapefile (Public_School_Locations).
  3. Use Select by expression to select the features that successfully joined with the spreadsheet and save that selection to a new shapefile. You will want to select all features where one of the fields that was joined from the spreadsheet IS NOT NULL.
  4. Use the Field Calculator to replace all s values in the columns that should be numeric with NULL.
  5. Create a new column for each column that should be numeric, converting the value in the original column from text to an integer.
  6. Now that we have numeric columns, use them to style the schools using graduated styles.

Part 2: Spatial Joins, points to polygons

Here we add data to NYC's school districts based on the SAT results of the schools that fall within them.

  1. Use the joined layer we created in the last part.
  2. Download the shapefile for NYC School Districts.
  3. Join by location by going to Vector > Data Management Tools > Join Attributes By Location:
    1. Make the school districts the Target vector layer.
    2. Make the schools with SAT scores the Join vector layer.
    3. Under Attribute Summary, select Take summary of intersecting features and leave Mean selected.
    4. Select a place to save the results and click OK.
  4. Examine the resulting shapefile's attribute table.
  5. Style the data using a graduated style.

Part 3: Spatial Join, polygons to points

This time we will add data to the schools by which school district each falls into.

  1. Clear the layers from the previous part or create a new project.
  2. Open the shapefile Public_School_Locations and the original school districts shapefile that you downloaded in the previous part.
  3. Join by location by going to Vector > Data Management Tools > Join Attributes By Location:
    1. This time make the schools the Target vector layer.
    2. And this time make the school districts the Join vector layer.
    3. Under Attribute Summary, select Take attributes of the first located feature.
    4. Select a place to save the results and click OK.
  4. Examine the resulting shapefile's attribute table.
  5. Style the resulting shapefile. For example, use a categorized style on school district number.