Visibility Analysis with QGIS
Turn-in for grading: This lab includes material that must be turned in for grading. Complete the required deliverables and submit them as instructed by the course.
Overview
This lab introduces two related terrain-analysis workflows:
- generating an elevation profile along a line of sight
- calculating a viewshed from an observation point
Both workflows use a DEM to ask questions about what the terrain allows someone to see.
You will:
- load a terrain model and line-of-sight features
- create a terrain profile along a specified line
- run a viewshed from a viewing station
- style the results for interpretation and map output
Concept note: Visibility analysis depends on both the elevation surface and the observer location. A DEM is not just a background image here; it is the mathematical surface used to test whether terrain blocks or allows visibility.
Getting Ready
You will need:
- L11.zip
- ViewStationSHP.zip if you need a replacement viewing-station shapefile
- WhiteboxTools installed in QGIS
Download and unpack the data
- Download L11.zip.
- If needed, also download ViewStationSHP.zip.
- Unzip the files somewhere stable on your computer.
- Create a project folder for this lab.
- Save a new QGIS project in that folder as
visibility_analysis.qgz.
Data for This Exercise
The main files are:
Qdrift.tifViewingStation.shpsight.shp
All are in NAD83 UTM Zone 15 with elevation values in meters.
If the ViewingStation.shp file in your copy of the lab data is not usable, use the replacement in ViewStationSHP.zip.
Part 1: Set Up the Visibility Project
- Start a new QGIS project.
- Add
Qdrift.tif,ViewingStation.shp, andsight.shp. - Move the shapefiles above the DEM if needed.
- Use the Layer Styling panel to make the viewing station and line of sight easier to see.
Concept note: The point layer identifies the observer location. The line layer identifies a specific directional slice through the terrain that will be used for the elevation profile.
Your starting map should look something like this, with the viewing station and sight line visible over the DEM:

Part 2: Create a Terrain Profile
Use the profile tool to examine how elevation changes along the line of sight.
- Open the Processing Toolbox.
- Search for Profile in WhiteboxTools.
- Set:
- Input surface file:
Qdrift - Input vector line file:
sight.shp
- Input surface file:
- Save the HTML output to your project folder.
- Run the tool.
The tool should open a browser page or HTML output showing the terrain profile along the line.
Take a screenshot of that profile for later use in your final layout.
Concept note: A terrain profile reduces the 3D terrain surface to a 2D cross-section along one line. It is useful for seeing ridges, depressions, and potential sight obstructions along a chosen path.
Use settings like these:

The output should open as an HTML page in your browser:

Part 3: Create a Viewshed
Now calculate which parts of the DEM are visible from the viewing station.
- In the Processing Toolbox, search for Viewshed under WhiteboxTools.
- Set:
- Input DEM:
Qdrift - Input viewing station file:
ViewingStation - Station height:
1.8
- Input DEM:
- Save the output as
viewshed.tif. - Run the tool.
The output should show visible and not-visible areas as raster values.
Concept note: The station height represents the observer's eye height above the ground. Changing it changes the visibility result because the line of sight begins from a different elevation above the terrain surface.
Use settings like these:

The raw output will usually look something like this before you restyle it:

Part 4: Style the Viewshed for Interpretation
The default grayscale output is not especially useful, so restyle it.
- Select the
viewshedlayer. - Open the Layer Styling panel.
- Change the render type from Singleband gray to Paletted/Unique values.
- Click Classify.
- For the class representing non-visible cells, change the opacity to
0. - For the class representing visible cells, choose a clear color of your choice.
This should allow the visible area to display on top of the DEM while leaving the non-visible area transparent.
Concept note: Making the invisible areas transparent helps the visibility result function as an analytical overlay rather than as a separate raster competing visually with the terrain beneath it.
The old workflow specifically used the palette classification step and then changed the classes manually:

Your styled result should allow the visible area to stand out clearly over the DEM:

Deliverable
Create and export a final layout that includes:
- the DEM as terrain context
- the viewing station
- the styled viewshed result
- the line of sight
- a screenshot of the profile result placed in the layout
- a title
- your name
- the date
- a scale bar
- a legend if it helps interpretation
Take and save the profile screenshot before you close the browser output, since it is part of the expected final layout from the original workflow.
What You Should Understand After This Lab
By the end of this exercise, you should be able to explain:
- how a terrain profile differs from a viewshed
- why observer location and observer height matter in visibility analysis
- how DEM-based visibility analysis uses the terrain surface to evaluate line of sight