0% found this document useful (0 votes)
33 views14 pages

IGR PracticalQGIS

Uploaded by

manan jatav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views14 pages

IGR PracticalQGIS

Uploaded by

manan jatav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Introduction to the Geological Record

Practical: Introduction to Digital Topographic data


During this practical, you will learn how to import topographic data into a software in
order to perform a basic topographic analysis. The software that you will use is called QGIS.
We used to use ArcMap but QGIS is free (you can download it on your laptop!)
The analysis will be performed in the area around the Lake District (that you will visit
during your field trip). The Digital Elevation Model (DEM) of the area is from SRTM. It is a
~30-m resolution DEM, which means that each pixel is approximately 30 meter wide. The
DEM is available on Learn.
During this practical, you will be dealing with a few large files. I strongly recommend that
you work on the hard drive of the computer, in the folder “Workspace” on C:
DO NOT FORGET TO COPY WHAT YOU HAVE CREATED IN THIS FOLDER AND
PASTE IT ONTO YOUR HOME DRIVE OR A USB STICK BEFORE LOGGING OFF (all
your work will otherwise be deleted when you log off). You will need ~100 Mb of space.

I. Downloading the topographic data.


I have put on Learn a zip file containing the DEM of the area and a picture of the
geological map of the area. Download the zip file, place it in a folder (e.g., create a
“practicalx” folder in “C:/Workspace”) and unzip the file. IMPORTANT: place all the files
from the zip file and all the files that you will create in a UNIQUE folder. This will simplify
your life later.

II. Opening QGIS + basic information.


Go to “Start” and open QGIS. Something like that will appear:

On the left of the QGIS window, two panels should be open: “Browser” and “Layers”. If you
want to open panels, go to View  Panels and select the ones you need. For example, you
should select the “Processing Toolbox” panel too. You then need to start a new project, either
by clicking the blank sheet icon or going to Project  New project. You are now ready to use
QGIS. Don’t forget to save your QGIS project from time to time.

If something doesn’t work in QGIS, make sure that you have enough space on your disk.

1
III. Basic Operations with QGIS + initial raster processing.
To begin with, you will load the DEM of the Lake District, downloaded straight from the
USGS EarthExplorer (http://earthexplorer.usgs.gov/): using the Browser panel, move to the
folder where you have placed the DEM (note the “refresh” arrows at the top, very useful if the
data do not appear). Double-click on “n54_w003_1arc_v3” and “n54_w004_1arc_v3”, or
drag them into the central panel. Click OK. Your window should look like that:

The “Layers” panel shows the different layers displayed. You can hide them, move them
up or down (= towards the foreground or background), or change their properties (for
example the colour scheme) by clicking on their name. NOTE: right-click and double-left-
click do different things!
In terms of colour, you can double-click on a layer and use the tab “Symbology” to
change from Singleband gray to Singleband pseudocolour, choosing a colour scheme in
Color ramp.
If you right-click on one of the layers in the “Layers” panel, you have the option of
removing it. When you remove something from QGIS, the file itself is not deleted: you can
import it again if you want.
You can zoom in and out and navigate in the landscape, using the mouse or the magnifier
and hand tools in the toolbar at the top. The magnifier with three arrows will fit the zoom to
display all the layers in the window. If you right-click on one of the layers in the layer
window, you have the option of “zooming to layer”: this can be very useful if you have lost
your image by navigating too far away from it.

Reminder: a raster is a grid made of pixels, each with a value that represents a property
of the pixel (in the case of a DEM, the value is the elevation of the pixel).

Now, some important points:


(1) QGIS still sees the two tiles as separate, which may cause problems if we want to look
at the shape of the river network for example (rivers will stop at the edge of the tiles).
(2) The DEM is distorted, because it hasn’t been projected: if you double-click on one of
the layers in the “Layers” panel and go to the “Information” tab, you will see that the
coordinate system (longitude and latitude) is in degrees. Note also the data type: Int16
– Sixteen bit signed integer; this will be important in the next step.

2
(3) The area presented is large and we don’t need it all. If we remove the parts we are not
interested in, operations will be faster and the files generated smaller.

Let’s solve these problems:

(1) We are going to Merge the rasters together: in the “Processing Toolbox” panel, go to
GDAL  Raster Miscellaneous  Merge. In the window that appears, click on the
(…) button under Input layers, select all and click OK. To maintain data integrity,
select Int16 as the output data type (see a few lines above!) Click the (…) under
Merged  Save to file  navigate to your working folder and give the output file a
name, e.g., “Merged”. Then click Run. The new file created will appear, being made
of one tile. You can now remove the two initial DEM files.

(2) We now need to Reproject (warp) the raster into a metric system. We are going to use
Universal Transverse Mercator (UTM), which is widely used. For UTM, we need to
specify the zone, as the projection is different for different parts of the world. There
are 60 zones, with either north or south (see map at the end of this handout). Most of
the UK are in zone 30N, which has the identifier EPSG:32630 in QGIS (within the
WGS 84 frame).

In the “Processing Toolbox” panel, search for Warp, which will appear under GDAL
 Raster projections  Warp (reproject). Double-click on it, select “Merged” as the
Input layer. For the Target CRS (“coordinate reference system”), click on the small
globe to the right and type EPSG:32630 in the Filter bar: WGS84 / UTM zone 30N
should appear  select it. In the Resampling method to use, select Cubic. Finally,
click on (…) under Reprojected, navigate to your working folder and give the new
raster a name, e.g., “Reprojected”. Then click Run. The new file created will appear,
slightly distorted. You can now remove “Merged”.

The QGIS window is still displaying the data in the old coordinate system. In the
bottom right, there is a little globe with the display system indicated (see below): click
on it and select EPSG:32630. The DEM should now be displayed without distortion,
as shown below. If you double-click on the “Reprojected” layer in the “Layers” panel,
and go to Information, you will see that the units are now meters. The size of the
pixels is also indicated, in meters too.

3
(3) Now, let’s Clip the area of interest, to boost the process and save space! Search for
“clip” in the “Processing Toolbox” and select Clip raster by extent under GDAL 
Raster extraction. In the window that opens, select your Reprojected raster as the
input layer and click (…) under Clipping extent  Select extent on canvas. This is a
very convenient tool, as you can directly draw a box in the window to select the area
of interest, as shown below. As you release the mouse button, the extent is specified
automatically. Then click on (…) under Clipped (extent)  Save to file  navigate to
your working folder and give your clipped raster a name, for example “ld” for Lake
District. This will be your base DEM for the rest of the analysis.

Remove all the other layers and keep only “ld”.


Well done, you are finished with the initial processing!

4
IV. Basic topographic analysis operations.

IMPORTANT: you can be lost very quickly, submerged by the number of files that you
will create. I suggest that for each file name, you use a prefix that refers to the area that
you are studying (or the exercise number) and a suffix that refers to the type of data.
Example: you can use the prefix “ld” for the Lake District exercise. “ld_hillshd” will be
the hillshade file of the area, “ld_slope” will be the slope file, etc.

1) Producing a shaded relief map of the area


Shaded relief can enhance some of the topographic features in the landscape. To generate
such a map, go to the “Processing Toolbox” panel  Raster terrain analysis  Hillshade.
This will open a window (see below left)  select the DEM from the dropdown list as the
Input raster and click on (…) under Hillshade  Save to file. Navigate to your destination
folder, give a name to the hillshade file (e.g. “ld_hillshd”) and click on Save, then click on
Run. You should obtain something like below right: can you spot hills, valleys and ridges?

Note that for an enhanced visualisation of relief, you can adjust the transparency of the
hillshade layer on top of the DEM: double-click on the hillshade layer in the “Layers” panel,
go to the “transparency” tab and select 50 % for example. The result is stunning, isn’t it?

2) Extracting topographic profiles


You may want to know how much relief there is in an area. Topographic profiles can
allow you to easily visualise the relief along a line of transect, for example from a ridge line
to another, across a valley or along a given path. Let’s try to image the relief along a line
going across the whole Lake District massif from the coast to the eastern side of the massif.
We will try to cut through a couple of the prominent valleys in the area.
You will need to install the “Profile tool” plugin: in the menus at the top, go to Plugins 
Manage and Install Plugins. Search for “Profile tool” and install it. It will add a new button to
your toolbar at the top (the little sunny green hill below).

Click on the button: a new window will appear, which will draw the profile in real time
(see below). Click on “add layer” to specify “ld” as the layer that contains the elevation data
that we want to sample. Then trace the line along which you would like the profile to be
traced (see example below). Double-click when you are finished.

5
If you are not happy with your line, trace a new line – it will automatically delete the previous
one. When you are happy with your line, you can save the profile as an image. You can also
use the tab “Table” and Copy the data to clipboard  you can then paste the data in Excel for
example, and produce a graph that you can edit. Elevation is in meters in this case. Note: the
left tip of the profile corresponds to the point where your line begins (it is West if you have
traced your line from W to E, it is East if you have traced it from E to W).

Note that my plugin seems to


have a problem, as the axes
don’t scale properly – we
shouldn’t have elevations
much below 0 m! This is a
bug, but the data in the table
are correct

So, how would you describe the relief in the Lake District?

6
3) Performing a slope analysis
Slope is probably one of the most useful pieces of information that can be used to assess
how geology affects topography. The steepness of the slope is usually (but not always!)
correlated to the resistance of the rocks exposed. To generate such a map, go to the
“Processing Toolbox” panel  Raster terrain analysis  Slope. This will open a window 
select the DEM from the dropdown list as the Input raster and click on (…) under Slope 
Save to file. Navigate to your destination folder, give a name to the slope file (e.g. “ld_slope”)
and click on Save and Run. You should obtain something like the image below left. You can
change the colour scheme to highlight differences in steepness (double-click on ld_slope 
“Symbology”), and zoom in areas of interest (see below right).

How would you describe the relief and the valley shapes in the area? Where are the steepest
slopes, and how steep are they? In which range are most slopes?

You will notice that the intervals for the colour values are designed to enhance the differences
in slope (if you expand the “ld_slope” information in the “Layers” panel). You may want to
display intervals with “cleaner” boundaries, in particular if you want to create a map with a
key (we won’t do that today). In the “Symbology” tab, you can choose to change the mode to
Equal interval, set the maximum value to a round number (e.g., 60 rather than 57.8352771)
and choose a number of classes that is a multiple of that number (e.g., 10). See for example
below. Once you have made your selection, click on Classify and OK.

7
V. Georeferencing images on the DEM.
The information displayed in QGIS so far is derived from the DEM so it allows you to
visualise mostly relief and geomorphology. However, you may want to investigate how the
geomorphology relates to other properties of the landscape: vegetation, human activity,
geology… In this section, you will learn how to take such information from other sources and
superimpose it on the topographic information in QGIS. In this case, we will use the
geological map (which is in the zip file on Learn) but you can do that with any sort of image
(e.g. GoogleMap if you want to look at vegetation for example).

We will need to georeference the images to make sure that they are superimposed (nearly)
perfectly on top of the topography. To proceed, we will use tie points which are remarkable
points that are easily recognisable on the different images, such as: summits, coastal
features, tributary junctions, lake features (termination, island, spur), major road
junctions, etc.

To help with the process, QGIS allows you to easily import a base map from
OpenStreetMap: in the “Browser” panel, click on “XYZ Tiles”: the OpenStreetMap layer
should appear underneath. Double-click on it or drag it into the window. You now have a very
useful base map that is automatically displayed in the coordinate system that you are working
in (in this case UTM 30N). You can see that it will be much easier to locate tie points on this
map than on the DEM!

If you navigate too far away from the Lake District, you can always “zoom to layer”
(right-click on one of your “ld” rasters).

Thank you Ujaval Gandhi for your tutorial!

8
https://www.qgistutorials.com/en/docs/3/advanced_georeferencing.html

We can now start the process: in the menu, got to Raster  Georeferencer.
If you do not see the Georeferencer, you will need to install the plugin from Plugins 
Manage and install Plugins  search for the Georeferencer GDAL.
A new window will open: go to File  Open Raster  select the raster that you want to
georeference (in this case, select “ld_geol”, but that could equally be a GoogleMap screenshot
that you would have saved as a JPG file).

In the window, go to Transformation Settings: this will open


a new window where we will specify the settings. There is a
range of transformation types and resampling methods available,
and you can learn more about it in your own time. We will
select Polynomial 2 for the transformation type and Cubic for
the resampling method. The Target SRS is very important: this
is the coordinate system in which the new raster will be
projected. Use the drop down menu and select UTM 30N
(EPSG:32630), which we have been using. Click on (…) next to
Output Raster: navigate to your working folder and give a name
(e.g., “ld_geol_georef”). Tick “Use 0 for transparency when
needed” and “Load in QGIS when done”, then click OK.

We are now ready to select the tie points. With this method,
we will need at least 6 points, distributed across the map. On the
geological map, locate your first target and zoom to it. In the
case below, I am focusing on a distinctive protrusion in Esthwaite Water. Go to Edit  Add
Point (or on the equivalent icon )  click on your target. A new window will open,
where you have to specify the coordinates of this point. Click on the “From map canvas”
button: you can then directly click on the target on the OpenStreetMap raster  the

9
coordinates will be collected directly from there. Then click OK. You now have your first tie
point (see below)! Five to go!

Notes:
- The software can be a bit slow between panels: be patient and don’t click madly if the
system becomes unresponsive! Just wait.
- Be aware that landscapes change rapidly! OpenStreetMap is regularly updated, so
some features may differ from your old map. Coastal erosion can be rapid (2 m / year
= 100 m in 50 years!), as can be urban development (Maryport on the west coast has
two lighthouses – I suspect the one on the geological map is the old one!)
- In our example, we select the coordinates of the tie points “from map canvas” but you
can enter these coordinates directly if you know them. This applies for example if you
can read the coordinates on the map that has been scanned, see for example:
http://www.qgistutorials.com/en/docs/georeferencing_basics.html.
For another cool example, see: http://fredgibbs.net/tutorials/qgis/overlaying-historic-
maps-with-qgis.html.

Repeat the operation so that you have six points in total. Note that the points will appear
in the “GCP table” (for Ground Control Point) under the geological map. If you make a
mistake, you can easily right-click on the erroneous point in the table and delete it.

10
When you have your six tie points, the error for each point will be indicated as dX and
dY. If there is a point with a very large error, it may be human error: delete it and select a
new one. Note that in the example below the error is “xxxxe-13”, which means xxxx 10-13,
which is very small. So I have done a good job!

If you’re happy with your work, go to File  Start georeferencing. The geological map
will be warped so that each of the tie points appears with the corresponding coordinates. If
you have done a good job, the map will appear in the right place: hide the OpenStreetMap
layer and change the transparency (or rather “Global opacity”). You should see something
like that:

You can now close the Georeferencer window and save the tie points.

Is the landscape morphology reflecting the underlying geology? Explore, and share
your ideas.

11
VI. Visualizing the landscape in 3D using…
Visualising information in 3D can enhance some of the observations even further. The
Qgis2threejs plugin has been designed to permit such visualisation in a professional manner.
Go to Plugins  Manage and install plugins  search for Qgis2threejs  install it.

The following icon will appear in the toolbar:

Click on it. A new window will appear, with a


“Layers” panel. In this panel, the rasters in your QGIS
project are displayed under “DEM”. This means you can
select which raster will be used for assigning elevation
values. Tick “ld”; note that you have the option of a “Flat
Plane” too, in case you want to display another type of
information on top of the flat plane (see for example this
short and fast video showing the display potential using
what seems to be a different version of Qgis2threejs:
https://www.youtube.com/watch?v=edPiNvZJScM).

The moment you tick the DEM layer, your 3D scene


will appear, displaying the layers that are displayed in your
QGIS project. If you want to remove a layer from the 3D,
go to your QGIS main window and hide the layer  the
3D should update automatically.

To enhance features, you can exaggerate the relief vertically: go to Scene  Scene
settings  change Vertical exaggeration (try to use 3). You can navigate through your
landscape with the mouse (try left-click, right-click and scroll) or keyboard.
You can export the 3D scene to the Web: File  Export to Web…
You can save the scene as an image: File  Save scene as  Image.

So, is the shape of the landscape reflecting the underlying geology? Explore the landscape
and try to determine whether some of the geological features could have been picked by
looking at the landscape. If some observations contradict your intuition (e.g., would you
expect granite surrounded by slate to stick out in the landscape, or the opposite?), then try to
think about the processes that have shaped this landscape over the last tens of thousands of
years… Feel free to discuss with the demonstrators.

12
REMINDER: IF YOU HAVE WORKED ON C:/WORKSPACE, DON’T
FORGET TO COPY YOUR WORK ON YOUR HOME DRIVE OR ON A
USB STICK BEFORE LOGGING OFF. Your work will be deleted when
you log off otherwise.

Please note: the geological map is provided for teaching use, not
for personal use (copyright BGS).

UTM
zones:

13
Geological map caption:

M. Attal, December 2019

14

You might also like