Skip to content

Instantly share code, notes, and snippets.

@kgjenkins
Last active September 11, 2020 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgjenkins/a3bd387beb6292a1ba4d02f43bbd5d7e to your computer and use it in GitHub Desktop.
Save kgjenkins/a3bd387beb6292a1ba4d02f43bbd5d7e to your computer and use it in GitHub Desktop.
ARCH 5115 - QGIS Workshop, Day 2

ARCH 5115 - QGIS Workshop, Day 2

The QGIS workshop folder on Box has been updated, so please download the entire "QGIS-workshops" folder to your computer.

  • Unzip the files
  • Double-click the workshop2.qgz project to open it in QGIS (or else open it from within QGIS)

Elevation raster data

Various scales of elevation data is available for the New Orleans region. The National Elevation Dataset (NED) covers most of the US at resolutions of 1/3 arc-seconds (~10-meter pixels), but thanks to a LiDAR survey, even finer detail is available from the LSU Atlas Lidar

Due to the large size of this statewide dataset, downloads are divided into smaller tiles. Twelve DEM tiles covering New Orleans have already been downloaded and unzipped for you. If you need other areas, those tiles can be downloaded from the LSU site above. Just click the tile you want, then select the "DEM" download.

  • Select all twelve DEM files and drag them onto your QGIS map.

Notice that each tile has a slightly different min/max range, which causes abrupt changes along adjacent tile edges. To combine all the tiles into a single, seamless layer, we will create a virtual raster:

  • Raster menu > Miscellaneous > Build Virtual Raster...
  • For "Input layers", click the "..." button, select all the DEMs, then click "OK"
  • Uncheck the box that says "Place each input file into a separate band"
  • Under "Virtual", click the "..." button, and select "Save to file"
  • Save it as "elevation.vrt" in the same folder where the .dem files are located
  • Click "Run"

Now you should have a seamless mosaic of the elevation data. You can now remove the original files from your project -- but don't delete them from your folder! (the .vrt points out to those file)

  • In the QGIS Layers panel, select all the original DEMs, then right-click > Remove Layer...

By default, raster data is displayed with a gray gradient, with higher values brighter. We can change the style to bring out more details in the data.

  • In the Layer Styling panel, change from "Singleband gray" to "Singleband pseudocolor"
  • Click the "Classify" button (below the blank white box)
  • Right-click the color ramp > Invert Color Ramp (so that lower areas are blue)

Notice that the minimum value is -14.2, meaning that there is at least one pixel with an elevation value that low. Does that mean 14.2 meters, or feet below sea level? Hint: look in the metadata, in the "Spatial Reference Information" section.

To better visualize which areas are below sea level, double-click the values to edit as follows:

  • 0 blue
  • 0.1 green
  • 5 yellow
  • 10 orange
  • 20 red

Notice that pixel values in between are shaded in between those colors. Also notice how some of the highest areas (red) are along the river. These are the levees that were built to protect the city from flooding. How high are they?

If we want to better see which of the blue areas are lowest:

  • Click the green "+" to add a new color to the value table
  • Set the value to -14 and the color to very dark blue

Notice the deep canals in the northern neighborhoods near Lake Pontchartrain.

Value Tool plugin

Although we could use the "Identify" tool to click pixels and see their values, the "Value Tool" plugin will allow you to instantly show the values from raster layers without even having to click.

  • Plugins > Manage and Install Plugins...
  • Search all plugins for "value tool" and install it

The Value Tool will appear on your toolbar as a green circle with white "i".

  • Click the Value Tool button to open the panel
  • Check the box to enable the tool
  • Move your cursor across the map to view the raster values

Try checking the elevations along the levees.

Elevation hillshade

Even though we can see structure of the levees and streets with the color ramp, it still looks rather flat. Let's use a hillshade to made it look more 3-dimensional.

  • In the Layers Panel, right-click the elevation layer > Duplicate
  • Right-click "elevation copy" > Rename to "hillshade"
  • Move the "hillshade" layer just above "elevation" and check the box to display the hillshade layer
  • Open the styling panel be sure that you are styling the "hillshade" layer
  • Change "Singleband pseudocolor" to "Hillshade"
  • Set the blending mode to "multiply" (which will let us also see the colorized version underneath)
  • You can adjust the strength of the shadow by adjusting the Z factor (3.0 works well, since the vertical units are in feet and the horizontal units are in meters, and there are 3.28 feet in a meter)
  • Try turning the dial to adjust the angle of the "sun"

Levee data

Although the elevation data pretty clearly shows the levees, it would still be useful to have a vector layer of lines that represent the levees.

A shapefile of levees for Louisiana was downloaded from the National Levee Database. Line features for the levees were found in the system.zip/layers/POLYLINE.shp, which was specified to be in EPSG:4326, which was incorrect. The CRS was corrected to EPSG:3857 and saved to a geopackage.

  • Load the levees/levees.gpkg file
  • Adjust the layer style to make it highly visible

Compare the line features to the elevation raster. Notice that, in addition to levees along the river and the lake, there are also some internal levees.

Imagery for specific years

Hurricane Katrina struck New Orleans in 2005, causing major flooding in areas like the Lower Ninth Ward. Let's take a look at this area using a basemap of Google imagery.

  • Turn off other layers, and turn on the Google Satellite basemap.
  • Turn on the Neighborhoods layer (labels will appear as you zoom in)
  • Zoom to the Lower Ninth Ward, located on the east side of the city, north of the river

Notice the blocks in the northwest part of the Lower Ninth Ward. Many houses were lost in this area, so this imagery is clearly from sometime after Katrina. What did it look like before?

While the Google and Big satellite basemaps are easy to use, we can't tell what year the imagery is from. Most states have some sort of imagery program in which various portions of the state are photographed each year, eventually resulting in a time series of imagery. Generally speaking, for most states, this started happening in the 1990s or early 2000s. Although there are older UDSA aerial photographs dating back to the 1930s, those images are often not readily available online, since significant work must be done to digitize, georeference, mosaic, and serve the images.

For Louisiana, the following URL points to a web service for a number of imagery sets, including New Orleans imagery for 1998, 2004, 2008, and 2010. (Some of the other layers only cover selected areas across Louisiana.)

If you open that link in a web browser, you'll see a list of the available layers. We can add any of those layers to our map by connecting QGIS to that URL.

  • Layer > Data Source Manager
  • Select the "ArcGIS Map Service" tab (near the bottom of the list on the left)
  • Click "New"
  • Set Name = "Louisiana Imagery"
  • Paste the URL and click OK

That sets up the connection to the web service, which will now appear in the dropdown menu of available services.

  • Click "Connect" and wait for the response (it may take several seconds)
  • Ignore the years at the end of each layer, and look for the 2004 imagery (la_doqq2004_LSU_2016)
  • Click the triangle to expand that item, and again
  • Once you see a sub-item called "Image", select it
  • Click the "Add" button (at the bottom of the dialog)

The imagery should appear on your map. The 2004 imagery is color-infrared, so vegetation will appear red (which makes it easier to distinguish plants from water, structures, and pavement). Notice that the name of the layer is simply "Image", which isn't very helpful, so you'll want to rename it now while you still remember what it represents.

  • Right-click the Image layer > Rename to "Imagery 2004"

Imagery for other years (or any ArcGIS MapServer layer) can be added the same way. Note that it is sometimes helpful to change your map CRS to match that of the ArcGIS MapServer layer -- right-click the layer name > Set CRS > Set Project CRS from Layer...

Georeferencing scanned map images

Georeferencing is the processing of aligning an image of a map to known coordinates, so that it can be viewed in the correct location as an overlay on your map. The process involves adding "ground control points" at various locations across the map, typically street intersections or other prominent features that can be clearly seen in both the map image and a reference layer or existing basemap.

(DEMO)

Demographic data

(DEMO)

Creating points from coordinate data

(DEMO)

Additional Data Sources

The following data sources are available as ArcGIS MapServer services, and can be added to your map as described above for "Imagery for Specific Years".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment