In-class Excercises
Part 1: Georeferencing
- Go to Urban Reviewer.
- 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.
- Click on the image to make it larger, then right click on it and save as to save it to your computer.
- Open QGIS.
- Add a satellite base layer with labels. I would suggest the Google Hybrid layer.
- Zoom to the general area your image should be in.
- Install or enable Georeferencer GDAL in the plugins area of QGIS.
- Go to Raster > Georeferencer > Georeferencer to open the Georeferencer window.
- Go to File > Open Raster and select the image you downloaded from Urban Reviewer.
- Add 3 or 4 ground control points:
- Switch between the Georeferencer and map windows and find a common point between the two (generally a street corner will be best).
- Click the Add point button in the Georeferencer window.
- Click on the common point in the Georeferencer window.
- When prompted to Enter map coordinates, select the From map canvas button.
- Click on the common point on the map.
- Once you are happy with the ground control points, click the Settings icon in the Georeferencer window.
- Set Transformation type to Thin plate spline.
- Set Target SRS to 3857 (the projection the reference map is in).
- Select a location to save to.
- Check Load in QGIS when done.
- Click Start Georeferencing in the Georeferencer window (looks like a play button).
- The Georeferenced image should show up on your map.
- Find a ground control point that doesn't line up as much as you would like.
- Delete the ground control point in the Georeferencer window.
- Add a replacement ground control point.
- 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.
Part 2: Landsat imagery
Here we use the Semi-Automatic Classification Plugin to download Landsat imagery. Unfortunately, the process requires downloading a large amount of data. If the download ends up taking too long, use the data (landsat.vrt) in the landsat folder in today's data and skip to step 14.
- Open QGIS.
- Add an QuickMapServices base layer and zoom to a part of the world you're interested in.
- Install or enable the Semi-Automatic Classification Plugin.
- Go to SCP > Tools > Download Landsat.
- Find and click the Update Database button. This may take a few minutes, and you should see a status bar in the main QGIS window (not the plugin window).
- Set the Area coordinates:
- Under UL, click + and click the upper left point of thearea you'd like to map on your map view.
- Do the same for LR, but for the lower right point.
- Update the Aquisition date to only look for images from this year.
- Make the Max cloud cover 10%.
- Under Satellites, only select 8 OLI (Landsat 8).
- Click Find images. This may take a few minutes, and the main map view should have a progress bar while it works.
- Select one of the more recent images and click Display image preview to see a low-res preview of the image.
- Click on Download Options and select only bands 2, 3, 4, 5, 6, and 7.
- Ensure that only if preview in layers is checked and click Download images from list. Select a location for your downloads and wait a few minutes while it goes. You may want to grab a coffee.
- In the Semi-Automatic Classification Plugin toolbar, find a field that has RGB= before it. This sets which bands are represented in red, green, and blue on the screen.
- Set the RGB field to 3-2-1. This should be true color (red, green, and blue are set to red, green, and blue).
- Try setting the RGB field to 4-3-2. This makes infrared show up as red, so vegetation should be red.
- Find the Common Landsat 8 band combinations table on this page and try some out. You will need to subtract 1 from each band number as we did not load band 1.
Part 3: LiDAR imagery
- Open landcover.tif from today's data in QGIS. This is an extract of the city-wide landcover data available on the open data portal.
- Experiment with using the Sieve function: Raster > Analysis > Sieve, select a place to save and a threshold (say 100). This will make smaller clumps of pixels become part of their neighboring clumps of pixels.
- Right click on the original image, select Styles > Copy Styles, then paste them into the sieved layer (right click, Styles > Paste Styles).
- Build vectors out of the resulting raster. Go to Raster > Conversion > Polygonize and select a location to save to.
- In the vector layer use an expression to select only the paved areas (gray in the raster).