How to Identify High Flood Risk Buildings in QGIS

Are you a civil engineer, planner, or GIS professional needing to quickly identify buildings at high flood risk? In this step by step QGIS tutorial, you’ll learn how to conduct a flood risk analysis using freely available tools. We’ll map potential flood extents from a Digital Elevation Model (DEM) and spatially query building footprint data to extract vulnerable structures, using Washington, DC as an example setting.

  1. Upload DEM and Building Outlines Data
  2. Enable GRASS tool
  3. Run r.lake
  4. Sieve the data
  5. Convert to polygon
  6. Select buildings within boundaries
  7. Export and save vector layer
Flood risk analysis created in QGIS

Step 1

Load DEM and Building Outlines Data

Data you’ll need for this analysis:

  • High-Resolution DEM: You can download LiDAR derived DEMs for your site of interest from sources like the USGS, or use Equator’s Data Menu to access high resolution DEMs that are ready for analysis without reprojection.

  • Accurate Building Outlines: Building footprint data is essential. For comprehensive and reliable building outlines data tailored for your specific site, Equator provides high quality downloadable vector layers that integrate seamlessly with our DEMs.

DEM and building outlines of Washington, DC for flood risk analysis

Raw DEM and Building Outlines of DC

Step 2

Enable GRASS tool

GRASS is a free built-in plugin in QGIS. To enable it or check if it is already installed:

Plugins → Manage and Install Plugins → search for “GRASS,” enable it

If you previously already enabled GRASS, skip this step.

GRASS GIS Plugin

GRASS plugin

Step 3

Run GRASS – r.lake

The r.lake tool from GRASS fills the low lying area to a given level from a starting point.

Processing Toolbox → GRASS → Raster (r.*) → r.lake

For the inputs, most settings can be left as default. The most important settings are as follows:

  • Elevation – the DEM
  • Water Level – different water levels such as 5, 10, 20
  • Seed point coordinates – Right click on a pixel on the DEM where the water would start flowing in and copy map coordinates

Pro tip: To model a river flood, you may need to run r.lake multiple times with seed points along the channel. For coastal flooding, place seed points along the shoreline.

In the Log tab, you can view what error the tool ran into if it did not run.

Common errors that you might run into here are: the water level is too low and seed point coordinates are not within the boundary. Depending on the location you select on the DEM for the seed point coordinates, the water level might need to be set to a much higher amount so that flooding could be calculated. For the seed point coordinate error, select another pixel adjacent to it.

Flood Risk - GRASS tool example inputs

r.lake tool with example inputs

Flood Depth - 5m flood result created with r.lake

5m flood depth result

Flood Depth - 20m flood result created with r.lake

20m flood depth result

Step 4

Sieve the data

Applying a sieve to the data will add thresholds and classify the data, making the raster cleaner for the next step.

Raster → Analysis → Sieve

Pro tip: It is suggested to use a threshold between 8-20 depending on the DEM’s resolution. At a higher resolution, the data generates finer details so setting a higher threshold removes the additional noise.

Flood Risk - sieve tool example inputs

Running the r.lake through a sieve

Step 5

Convert to Polygon

The data right now is still in raster and all the steps moving forward are manipulations of vector data. We must convert the flood data rasters into vector polygons.

Raster → Conversion → Polygonize (Raster to Vector)

Pro tip: If it generated the entire extent, select all polygons below or above a certain threshold of your choice and delete them. The vectorized tool might generate a number of small nonuniformed polygons. To create a clean singular polygon, run the polygon layer through the Union tool.

Flood Risk - polygonize tool example inputs

Converting raster to polygon

Step 6

Select by Location

To extract all the buildings that are within the flood polygon boundaries, overlay the building outlines on top of the flood polygon

Vector → Research Tools→ Select By Location

Inputs:

  • Select features from: Building Outline
  • Use intersect
  • By comparing to the features from: flood extent polygon
Flood Risk - Select by Location example inputs

Select by Location with the correct input

Step 7

Export buildings

With the new selection, you make a new feature layer with only these buildings that are within the flood extent.

Layers pane → Right click on the Building Outline polygon → Export → Save selected feature as

The rest of the inputs could be left as the default settings.

Flood Risk - Export example inputs

Contour tool with default inputs and outputs

Example of the flood risk map. Yellow buildings are buildings affected by 5m flood depths.

Example of the flood risk map. Yellow buildings are buildings affected by 5m flood depths.

Official DC Flood Risk map. Blue and orange polygons represent different flood depths.

Official DC Flood Risk map. Blue and orange polygons represent different flood depths.

Interpreting Results and Next Steps

  • Compare different flood depths: You can repeat step 4 to 7 to create multiple polygons of various flood levels, then compare them to see which buildings are affected at these levels.
  • Visualize for Reports: Style the flooded buildings, flood polygons, and base map for impact in maps.
  • Quantify the Risk: Use the Field Calculator to calculate the total number or square footage of affected buildings.
  • For Advanced Analysis: This QGIS derived layer can be used as an input for further consequence analysis or to prioritize detailed studies

Ready to apply this method to your project?

You’ll need high-quality base data. Explore Equator’s Site Menu to access the high resolution DEMs and accurate building outline data that you can use to make similar analysis. For more guides, check out our other blogs and “How-to tutorials”.