In this tutorial you will convert a digital elevation model (DEM) along a river of your choice into a relative elevation model (REM) in QGIS using a series of steps that include the Inverse Distance Weighted (IDW) interpolation method.
The example dataset is a bare-earth lidar DEM (aka digital terrain model or DTM) along the Carson River in western Nevada. 
The tutorial is geared toward users who have some experience using GIS and have QGIS installed on their computer. Users will also need a DEM along a river of their choice to get started (go here if you need a DEM). This tutorial will likely take approximately 2 hours to complete, but the time may differ depending on the length of your river and processing time. 
This tutorial can be done independently or in combination with the: Downloading and Preparing Lidar DEMs for REM Processing tutorial and the Exporting Images from QGIS tutorial.

REMs, an Introduction
In floodplains, lidar digital elevation models (DEMs) can be converted to relative elevation models (REMs) to better visualize river features that are difficult to discern using an aerial photo or lower-resolution DEM. REMs, also know as height above river (HAR) rasters, are produced by detrending the baseline elevation to follow the water surface of the stream. In a DEM, the baseline elevation (0 feet or meters) is at sea level and the downstream part of a river has a lower elevation than the upstream part. In a REM, the baseline elevation (0 feet or meters) is detrended to follow the water surface of a river—elevations trend higher as one moves away from the river, showing the "relative" height above river.
REMs are extremely useful in discerning where river channels have migrated in the past by vividly displaying river features such as meander scars, terraces, and oxbow lakes. This type of information is very informative in channel migration and flood studies, as well as a host of other engineering, habitat, and cultural assessments.

Left: A standard digital elevation model of the Carson River with the baseline elevation (0) at sea level. Right: A relative elevation model (REM) of the same area with the baseline elevation (0) at the water surface of the river.

Another reason I personally make REMs of rivers, however, is that they are intrinsically beautiful. Many REMs translate into wonderful flowing artistic images that are a visual time capsule of a river's natural history. They are a subject that satisfies both a scientific and aesthetic curiosity about the world. 

Relative elevation model of the Snake River in Grand Teton National Park, Wyoming.

REMs can be created using a number of different methods. I have written QGIS methods for two techniques, the IDW method (this tutorial) and the Cross-Section method (the next tutorial). These methods were adapted from the ArcGIS Desktop steps described by Olson and others (2014). These techniques use point (IDW) and line (cross-section) GIS data that possess elevations corresponding to the river's surface. These data are interpolated to create a new raster surface and then subtracted from the original DEM raster to create the REM.
Occasionally, more than one iteration of the model is needed to accurately represent the water surface at 0 elevation. Some common factors and features that reduce model accuracy are: rivers with a steep elevation gradient, rivers with high sinuosity, dams, steep waterfalls, tidal areas, braided channels, and mosaicked datasets from different time periods.​​​​​​​

Large, slow moving, meandering rivers represented with high-resolution lidar DEMs work best for these techniques, but don't let that stop you if your river and dataset don't fit these criteria. I have seen very interesting results from an array of river types and raster resolutions. 
If you have a single DEM that is ready to go you can dive right in to this tutorial. If you are looking for a dataset I encourage you to use the Downloading and Preparing Lidar DEMs for REM Processing tutorial to get started.
These are some of the first tutorials that I have written so I welcome any feedback that will make them better. As with all things GIS, there are multiple ways to do things, so if there are more efficient steps that will improve the methods described here please let me knowI hope to add a video version of this tutorial (and the others) in the future and the feedback will make those efforts easier. Also, if anyone wants to write a script for these steps, please do! The beauty of the IDW method is that it only needs two inputs—a river centerline and a DEM.
To read more about REMs, click on the poster below.

Creating the REM
A. Create a project folder and put your river DEM there. 
Open QGIS, then save the QGIS project to your project folder.
For this tutorial I used QGIS 3.16 Hannover Long Term Release, but the steps should be the same for all recent releases. 
Remember to save your project periodically throughout this tutorial so you don't lose your work!
Once QGIS is open, drag your DEM (in this case, the carson_river.tif) into the Layers window, or load it with the Data Source Manager. 
If you get a Select Transformation window when you add the data, select ok.

B. Select the Identify Features tool (see below). 
With the tool selected click on the raster near the upstream and downstream end of your river to get the general elevation range (Band 1 in the results window shown below) along the river. 
You might have to click around and explore a little to get the range. 
Make a mental note of the high and low elevations (or write them down) that you find on the upstream and downstream ends of your study area. 

C. Right click on your DEM in the Layers window and select Properties.
D. In the Layer Properties window select Symbology in the panel on the left. 
Select the Render type dropdown and select Singleband pseudocolor.

E. Enter the the low and high values of your sampled elevation ranges into the Min and Max boxes
Select the Color ramp drop down and choose a color ramp that ranges from light to dark—preferably one that doesn't have too many jarring color changes. 
Select Ok or Apply to apply the elevation and color changes to your DEM.

F. Take a look at your raster to make sure you can see the section of the river that you are interested in. 
Adjust the Min/Max elevations in the Layer properties window as needed until you have a good range of color along the river (like the image below).
G. Make a copy of your DEM. Right click on the DEM in the Layers window and select Copy Layer. 
Then right click in the Layers window and select Paste Layer/Group to paste the copied layer.

H. Right click on the top DEM layer in the Layers window and select Properties. 
In the Layer Properties window Select the Render type drop down and choose Hillshade

I. While still in the Layer Properties window, enter 5 in the Z Factor box to exaggerate the elevation for the hillshade (adjust this to your preference later if needed).

elect the Transparency tab and then adjust the transparency sider to 50%. 
Then select OK at the bottom right.

K. The exaggerated hillshade will make the main river channel more defined and easier to see for the upcoming steps.

L. Create a river centerline
Add a line file type of your choice. 
In this case I added a shapefile (shown below). 
Select the file location and name (I usually name it something like rivername_centerline). 
For Geometry type select Line
Use the projection dropdown to select the Project CRS
Select Ok.

M. Right click on the newly created river centerline file and open the Layer properties. 
Select the Symbology tab
Click on Simple line near the top and choose a color that you will be able to see against the background of your DEM. 
Enter "1" in the stroke width box. Select Ok.

N. With your river centerline file selected in the Layer window, click on the Toggle Editing button to enable editing. 
Then select Add Line Feature and draw a river centerline over the river in your DEM across your entire area of interest. 
Make sure that the line is over the river surface and that is doesn't go over the adjacent land.
If you need to edit the line after you draw it use the Vertex tool (tool to the right of the Add Line Feature button).

O. When your river centerline is complete go to Plugins>Install Plugins.

P. In the search box type Qchainage. 
Select the Qchainage tool and select Install Plugin, then Close.

Q. Select the Measure Line tool.

R. Use the Measure Line tool to measure the width of the river. 
In the example below the river is about 40 meters wide. 
This measurement will be used in the next step.

S. Open the Qchainage tool that you added from the Plugins menu. 
Select your river centerline for the Layer to chainage and add the river width measurement (Chainage every XX meters) from the previous step. 
Select OK.

T. The resulting point file will look similar to the example below.

U. Go back to Plugins>Manage and Install Plugins and type Point Sampling tool into the search box. 
Select the tool and click Install Plugin.

V. Open the Point Sampling tool and select the river centerline point file for the Layer containing sampling points
Then double click on your original DEM file in the list under Layers with fields/bands to get values from
Add a file name and location and click OK.

W. After the new point elevation file has been added to the Layers panel, go to Processing>Toolbox.

X. In the Processing Toolbox panel select Interpolation>IDW Interpolation
In the IDW Interpolation window select your new point elevation file as the Vector layer
Select the attribute that has the extracted elevations (in the example below carson_riv). 
Click the add button to add the attribute. 
Make sure that the Type is set to Points
For the Extent select Calculate from Layer and your original DEM file from the drop down menu. 
For Pixel Size add 10 to both boxes (or a number that is 10 times your original DEM raster resolution). 
We will resample this back down to a 1 meter raster (original DEM resolution) in the next step (which is faster than processing it at 1 meter resolution in this step).
Select Run.

Y. The resulting IDW raster will look similar to the raster shown below.

Z. Select Raster>Projections>Warp (Reproject). This tool will be used to resample the IDW raster to 1 meter.

AA. In the Warp (Reproject) window set the Input layer to your IDW Interpolated raster. 
For the Source CRS select the Project CRS from the drop down. 
Set the Resampling method to Bilinear
For the Output File Resolution enter the resolution of your original DEM, in this case 1 (meter).
For Profile select High Compression.
For the Georeferenced extents of the output file select Calculate from Layer and your original DEM file from the drop down menu. 
For the CRS of the target raster select the Project CRS from the drop down. 
Select Run and take a break, this process will take several minutes.

BB. After the new raster layer has been added from the Reproject tool go to Raster>Raster Calculator.

CC. In the Raster Calculator window, select the file name and location next to Output layer (this will be your REM)
For Output format choose GeoTIFF.
For the Output CRS select the Project CRS from the dropdown.
Double click the original DEM layer in the Raster Bands window to add it to the Raster Calculator Expression box below. 
Then click on the minus sign to add a minus to the expression. 
Finally, double click on the new Resampled (Reprojected) raster to add it to the expression and then click OK.

DD. The resulting REM layer will look similar to the raster shown below.

EE. In the Layer Properties window for the new REM file select Singleband pseudocolor for the Render type. Enter 0 for the Min value and 10 for the Max value. Then select the same color ramp as your original DEM. Select OK.
FF. The example REM (below) with Min/Max values of 0 and 10. 
You can adjust the values—particularly the Max value—to get the desired visual result that you would like.

GG. The example REM (below) with Min/Max values of 0 and 5. 

HH. A comparison of the REM and the original DEM.

You can export the image from QGIS using the Layout function. Go to the Exporting Images from QGIS tutorial to learn more. 
Congratulations on completing this tutorial! Hopefully you found this useful. If you have any questions, comments, or recommendations for making this better, use the contact page to send me a message. This is one of my first tutorials, so I look forward to fixing any mistakes that I made! I plan to add a video version of this and the other tutorials in the future. 
Back to Top