Hello everyone, welcome to another GIS Tutorial. In this article, we will learn how to assign elevation from a DEM in QGIS. I have a point layer with the X and Y coordinates but not the Z (elevation) value. So, we will try to assign the elevation to this point layer from a DEM. QGIS has the capability to assign the elevation from a DEM. We will show you how to do it in this article.
Steps to Assign Elevation from a DEM in QGIS
Step 1. Prepare the DEM
A Digital Elevation Model (DEM) is a geospatial dataset that represents the Earth’s surface topography in a digital format. Digital Elevation Models (DEMs) can be obtained through various methods and sources, depending on the area’s coverage and the required level of detail. Here are some common methods for obtaining DEM data:
- LiDAR (Light Detection and Ranging): LiDAR technology uses laser pulses to measure the distance between the sensor and the Earth’s surface. It can generate highly accurate and detailed DEMs. LiDAR data is collected from aircraft, drones, or ground-based systems.
- Photogrammetry: Aerial or satellite imagery is used to create 3D models of the Earth’s surface by identifying the position and elevation of key points in multiple images. This method can produce medium to high-resolution DEMs.
- Satellite Data: Some satellite missions, like the Shuttle Radar Topography Mission (SRTM) and the Advanced Spaceborne Thermal Emission and Reflection Radiometer (ASTER), have collected elevation data from space. These provide global coverage but may have lower resolution.
- Ground Surveys: Traditional land surveys involve measuring elevation points on the ground using theodolites, total stations, or GPS devices.
- Interpolation: For areas with limited data, interpolation techniques are used to estimate elevations between known points. Common interpolation methods include inverse distance weighting (IDW) and kriging.
- Open Data Sources: Many governments and organizations provide publicly accessible DEM datasets. These can be downloaded for free or at a low cost, making them a convenient option for various applications.
- Commercial Data Providers: Some companies offer high-resolution DEM data for purchase. These datasets often come with additional features and customization options.
- Crowdsourced Data: In some cases, elevation data may be collected through crowdsourcing efforts, where individuals contribute GPS data or other elevation information.
At this point, I assume you already had the DEM that we will use. We can also build a DEM from data points. Please read this article to build a DEM from points.
Step 2. Prepare the Point Layer
Now let’s prepare our point layer in QGIS. In this example, I created a point layer on top of the DEM. See the picture below for the illustration.
As you can see below, the point table only has X and Y information. We will add one more column (Z) which is the elevation for each point based on the DEM.
Step 3. Assign the Elevation
To assign elevation from raster (DEM) in QGIS, we will use the Drape (set Z value from raster) function. Search for this tool under the Processing Toolbox in QGIS. Double-click the tool to open.
Choose the point layer on the Input Layer and then select the DEM from the Raster Layer. Leave other options unless needed. Click Run to run the tool. It will create a new layer called Draped. If you open the attribute table for the Draped layer, you won’t see the Z value yet.
Open the attribute table for the Draped layer and then click Open Field Calculator. Create a new Field called Z and then type $Z in the Expression as shown below. Click OK.
Now we have a new Z column containing the elevation value for each point.
Thank you for reading the article.