← Methods 3

In-class Exercises

Part 1: Spatial Joins

  1. Download this class's data.
  2. Open the shapefiles in school-districts and schools-join-sat-results.
  3. Use Join Attributes by Location (Summary) from the search bar to find the average (mean) SAT math score by school district.
  4. Style the school districts by the average score.

Part 2: Geocoding

  1. Open the Census Bureau's batch geocoder.
  2. Geocode the CSV file in the folder Trade Waste Hauler Licensees named haulers-excerpt-to-geocode.csv.
  3. Open the result in QGIS.

Part 3: Hexbins

Use hexbins to look at the density of uber_2014_04_01 or Graffiti_Locations.

  1. Open the points file of your choosing (uber_2014_04_01 or Graffiti_Locations).
  2. Move your project into a projection where you know the units (eg, 2263 is in feet).
  3. Use the QGIS search bar to search for Create grid.
  4. Select Hexagon for the grid type, set the grid extent to Use layer/canvas extent > Use extent from (your layer name).
  5. Set the Horizontal spacing and Vertical spacing to 1000 feet to start.
  6. Pick a suitable place to save to and create the grid.
  7. If the grid's hexagons are too large or too small, repeat the process but change the Horizontal spacing or Vertical spacing. These determine the height and width of the hexagons.
  8. Count the number of points in each hexagon and make a choropleth with the resulting layer.

Part 4: Heatmaps

Using the same points layer as last time, make a heatmap.

  1. Search for Heatmap (Kernel Density Estimation) in the QGIS search box.
  2. Set the radius to 2000 feet.
  3. Set the rows to 3000. This is the number of rows of pixels in the resulting raster. The columns should update automatically.
  4. Style the output raster with a Singleband Pseudocolor render type and select a color ramp.
  5. Create a few more heatmaps with varying radii and resolution (rows and columns).