Working with Terrain Data (QGIS3)

Terrain or elevation data is useful for many GIS analyses, and it is often used in maps. QGIS3 has good terrain processing capabilities built-in. In this tutorial, we will work through the steps to generate various products from elevation data such as hillshade and contour.

Overview of the task

The task is to create contours and a hillshade map for area around Mt. Everest.

Other skills you will learn

  • Searching and downloading freely available terrain data.

  • Exporting a vector layer as KML and viewing it in Google Earth.

  • Smoothing of contour lines.

Get the data

We will be working with GMTED2010 dataset from USGS. GMTED (Global Multi-resolution Terrain Elevation Data) is a global terrain dataset that is the newer version of GTOPO30 dataset.

Here is how to search and download the revelant data from USGS Earthexplorer.

  1. Go to the USGS Earthexplorer . In the Search Criteria tab, click on World Features. In Feature Name enter Everest, in Country enter NEPAL, click on Show. This will display a table with the location information. Select Everest under Placename.

  1. Now the canvas will move to Mt. Everest location. Click on Data Sets.

  1. Expand the Digital Elevation group, and check GMTED2010. Click on Results.

  1. Click the Download Options button.


You will have to log in to the site at this point. You can create a free account if you do not have one.

  1. Select the 30 ARC SEC option and click Download.


You will now have a file named Elevation data is distributed in various raster formats such as ASC, BIL, GeoTiff, etc. QGIS supports a wide variety of raster formats via the GDAL library. The GMTED data comes as GeoTiff files which are contained in this zip archive.

For convenience, you can download a copy of the data directly from below.

Data Source: [GMTED2010]


  1. Open Layer ‣ Add Layer ‣ Add Raster Layer.

  1. Click on the under Source, search and select the file named 10n060e_20101117_gmted_mea300.tif.

  1. You will see the terrain data rendered in the QGIS Canvas. Each pixel in the terrain raster represents the average elevation in meters at that location. The dark pixels represent areas with low altitude and lighter pixels represent areas with high altitude.

  1. Let’s find our area of interest. From Wikipedia, we find that the coordinates for our area of interest - Mt. Everest - is located at the coordinates 27.9881° N, 86.9253° E. Note that QGIS uses the coordinates in (latitude, longitude) format when the CRS is set to EPSG:4326. Therefore, paste the value 27.9881, 86.9253 these at the bottom of the QGIS window where it says Coordinate and press guilabel:Enter. The viewport will be centered at this coordinate. To zoom in, Enter 1:1000000 in the Scale field and press Enter. You will see the viewport zoom to the area around the Himalayas.

  1. We will now crop the raster to this area of interest. Search for Clip in Processing Toolbox. Select the Clip Raster by extent under GDAL algorithms.

  1. In the Clip Raster by Extent window, select 10n060e_20101117_gmted_mea300 as Input Layer, click ... in Clipping extent and select Use Map canvas extent, click ... in Clipped (extent) and enter the name as mt_everest.tif. Click Run.

  1. A new layer mt_everest will appear in the canvas. Search for Hill in Processing Toolbox. Select the Hillshade algorithm under GDAL algorithms.

  1. In the Hillshade window, select mt_everest as Elevation Layer, enter 315.000 in Azimuth (horizontal angle), enter 45.000 in Vertical angle. Click ... in Hillshade and enter the name as mt_everest_hillshade.tif. Click Run.

  1. A new layer mt_everest_hillshade will appear in the canvas.

  1. Search for Contour in Processing Toolbox. Select the Contour algorithm under GDAL algorithms.

  1. In the Contour window, select mt_everest as Input Layer, enter 250 in Interval between contour lines. Click ... in Contours and enter the name as mt_everest_contour.gpkg. Click Run.

  1. A new layer mt_everest_contour will appear in the canvas. Right-click on the layer and click Open Attribute Table.

  1. You will see that each line feature has an attribute named ELEV. This is the height in meters that each line represents. Click on the column header a couple of times to sort the values in descending order. Here you will find the line representing the highest elevation in our data, i.e. Mt. Everest.

  1. Select the top row, and click on the Zoom to selection button.

  1. Switch to the main QGIS window. You will see the selected contour line highlighted in yellow. This is the area of the highest elevation in our dataset.

  1. Search for Smooth in Processing Toolbox. Select the Smooth under Vector geometry.

  1. In the Smooth window, select mt_everest_contour as Input Layer, enter 5 in Iterations. Click Run.


The smoothing algorithm works by adding extra vertices along the lines. As you increase the number of iterations, the number of vertices in the contour lines increase by a large amount. So be careful in using higher number of iterations. You can reduce the file size of the output by exporting it as a shapefile and simplifying the results using Mapshaper.

  1. A new layer Smoothed will appear in the canvas. This layer will have more smooth edges compared to the mt_everest_contour layer.

  1. You can also visualize your contour layer and verify your analysis by exporting the contours layer as KML and viewing it in Google Earth. Right click on the smoothed layer, select Export ‣ Save Feature As….

  1. Select Keyhole Markup Language [KML] as the Format. Click ... in File name and enter the name as contour_smoothed.kml. Click OK.

  1. Browse to the output file on your disk and double-click on it to open Google Earth Pro.


If you want to give feedback or share your experience with this tutorial, please comment below. (requires GitHub account)