This tutorial explores basic techniques for working with rasters in QGIS such as mosaicing and subsetting.
We will download elevation data for Sri Lanka in form of SRTM tiles, merge them and clip the resulting mosaic to the country boundary.
Land Processes Distributed Active Archive Center (LP DAAC) provides NASA Shuttle Radar Topography Mission (SRTM) Global 1 arc second dataset as elevation tiles.
An easy interface to download tiles for a given area is the 30-Meter SRTM Tile Downloader by By Derek Watkins. Download the individual SRTM tiles covering Sri Lanka. Note that you will need a free Earth Data account to download the data.
We will also need the Admin 0 - Countries shapefile from Natural Earth.
For convenience, you may directly download a copy of the datasets from the links below:
Data Source [SRTM] , [NATURALEARTH]
.hgt
files. Hold the Ctrl
key and select all individual files. Once selected, drag them to the canvas.Int16
as the Output data type. Also the default output data format is GeoTiff. GeoTiff files can get very large if not compressed. Choose High Compression
as the Profile. Click Run.OUTPUT
will be added to the Layers panel. In case the layer is not at the top of the stack, select it and drag it to the top of the Layers panel.OUTPUT
layer contains the merged elevation data from the individual input tiles. The default visualization only shows the pixel values in the range from 0-255. But our data contains pixels with values -14 to 2371, resulting in a low contrast rendering. Let’s change it a better visualization. Click the Open the layer Styling panel button in the Layers panel.Hillshade
renderer. This rendering option is particularly well-suited for elevation data.ne_10m_admin_0_countries.zip
file and expand it. Drag the ne_10m_admin_0_countries.shp
file to the canvas.ne_10m_admin_0_countries
layers in the Layers panel. Click the Select Features by area of single click button on the Attributes Toolbar. Once selected, click the polygon for Sri Lanka to select it.OUTPUT
as the Input Layer. Select ne_10m_admin_0_countries
as the Mask layer, and check the Selected features only checkbox. Enter 0.0000
as the Assign a specified nodata value to output bands. As before, choose High compression
as the Profile. Click Run.OUTPUT
will be added to the Layers panel. At this point, it may be hard to see the output because we have too many overlapping layers visible. Click the Manage Map Themes button in the Layers panel and choose Hide All Layers
.OUTPUT
layer and style it with the Hilshade
renderer as done before.This work is licensed under a Creative Commons Attribution 4.0 International License