← Introduction to GIS Software: QGIS

In-class Excercises

Part 1: Hexbins

Here we make two choropleths using Points in polygon—one with the PA counties and one using a grid of hexagons.

  1. Open Oil_Gas_Well_Historical_Production_Report.csv from last time's data or download it now. We will call this data the "wells" layer from now on.
  2. Save the wells as a new layer and convert to projection 3650. Remove the original wells layer.
  3. Open PaCounty2015_01.shp, use Save As to save in the projection 3650, and use Points in polygon to count the number of wells in each county. Make a choropleth of the result.
  4. Ensure your project is also in projection 3650. Check in Project > Project Properties.
  5. Install the MMQGIS QGIS plugin if you have not.
  6. Create a hexagon layer using MMQGIS, MMQGIS > Create > Create Grid Lines Layer:
    1. Browse for a location for the new shapefile.
    2. Change the dropdown at the bottom to Hexagon.
    3. Adjust the size of the hexagons by changing H Spacing to 52800.
  7. Count the wells in the resulting hexagons using Points in polygon.
  8. Make a choropleth with the resulting layer.

Part 2: Heatmaps

  1. Install (or enable) the Heatmap QGIS plugin if you have not already done so.
  2. Open the wells file projected to 3650 from the previous part.
  3. Create a heatmap by going to Raster > Heatmap > Heatmap:
    1. Select an output raster location.
    2. Set the Radius field to 10560.
  4. Style the output raster. Use Singleband Psuedocolor.
  5. Make more heatmaps, adjusting:
    • the resolution of the raster (rows and columns)
    • kernel shape

Part 3: Creating Shapefiles

  1. Clear all existing layers in QGIS.
  2. Load a satellite layer and zoom to an area of interest.
  3. Create a shapefile: Layer > Create Layer > New Shapefile Layer.
  4. In the New Vector Layer dialog:
    1. select Point for Type,
    2. leave File encoding as it is,
    3. pick a projection, and
    4. add a few attributes, with a few different Types.
  5. Turn on Editing Mode for the new layer (Layer > Toggle Editing).
  6. With the Add Feature tool and the satellite layer as a reference, add a few points and add data to the points when prompted.
  7. Use the Move Feature tool to move one of your points.
  8. Create a shapefile of lines. Use the satellite imagery to trace and create some roads and/or waterways. Right-click to finish each line.
  9. Create a shapefile of polygons. Use the satellite imagery to trace and create features for buildings, areas, and/or larger waterways. Right-click to finish each polygon.
  10. Experiment with other edit functions available under the Edit menu.

Part 4: Georeferencing

  1. Go to Urban Reviewer.
  2. Find an urban renewal plan with a map image on the right when you select it. If you have a hard time finding one with a scanned map, use the Pratt Institute plan.
  3. Click on the image to make it larger, then right click on it and save as to save it to your computer.
  4. Open QGIS.
  5. Add a satellite base layer with labels. I would suggest the Google Hybrid layer.
  6. Zoom to the general area your image should be in.
  7. Install or enable Georeferencer GDAL in the plugins area of QGIS.
  8. Go to Raster > Georeferencer > Georeferencer to open the Georeferencer window.
  9. Go to File > Open Raster and select the image you downloaded from Urban Reviewer.
  10. Add 3 or 4 ground control points:
    1. Switch between the Georeferencer and map windows and find a common point between the two (generally a street corner will be best).
    2. Click the Add point button in the Georeferencer window.
    3. Click on the common point in the Georeferencer window.
    4. When prompted to Enter map coordinates, select the From map canvas button.
    5. Click on the common point on the map.
  11. Once you are happy with the ground control points, click the Settings icon in the Georeferencer window.
  12. Set Transformation type to Thin plate spline.
  13. Set Target SRS to 3857 (the projection the reference map is in).
  14. Select a location to save to.
  15. Check Load in QGIS when done.
  16. Click Start Georeferencing in the Georeferencer window (looks like a play button).
  17. The Georeferenced image should show up on your map.
  18. Find a ground control point that doesn't line up as much as you would like.
  19. Delete the ground control point in the Georeferencer window.
  20. Add a replacement ground control point.
  21. Georeference it again—by default your georeferenced image will be overwritten, so change the destination in the georeferencer settings if you want to make a new file.