Professional Documents
Culture Documents
Introduction to GIS
GIS is an incredibly powerful tool for spatial and temporal analysis. It would be
impossible to try and comprehensively teach you how to do everything which GIS can
do – there’s simply too much, and most of it wouldn’t be useful for you in the short term.
Instead, what we aim to do for this module is to give you an idea of what is possible. If
you know that something is possible, a time might come when you want to use it – at
which point you can learn how to do it. But if you don’t know that something is possible,
it may never occur to you to try.
This series of exercises is designed to introduce you to GIS, using the open source
software QGIS; and to demonstrate to you some of the range of what is possible in
QGIS in particular, and in GIS in general, by working on data relating to fluvial (river)
flooding in Ireland.
Over the coming weeks, we’re going to make a few different maps, mapping a few
different datasets. This week, we’ll start by making a base map with the rivers, lakes,
and the locations where the OPW records the water level in rivers. This will be useful
for looking at the physical geography aspects of flooding, and will also serve as a base
map for adding more data in the coming weeks.
I should note at this point that this exercise looks very long. It’s not. The length of this
document is vastly inflated by the number of screenshots in it to help you through the
process. I’ve tried, as far as possible, to show you how to do absolutely everything,
while leaving you a bit of flexibility. That said, this isn’t a 10-minute job; it’s possible to
finish it in the lab time, but it’s more likely that you’ll need to finish it in your own time
afterwards.
At the end of the exercise, you will have produced a map focused on an individual area.
The future exercises will build on this by adding more data.
This exercise is adapted (using different data) from Discover QGIS 3.x by Kurt Menke. If
you want to really explore QGIS, I can’t recommend that book strongly enough. You can
find it in the Library.
1
Introduction to GIS
Open QGIS. In the Start Menu, you might see multiple different options, including QGIS
Desktop and QGIS Desktop with GRASS. GRASS is an add-on that we won’t be using
right now, but either will work just fine. If you have installed the latest version, you’re
looking for QGIS Desktop 3.22.3.
Menu bar
Toolbars
Browser
panel Map Canvas
Layers
panel
The main part of the QGIS window is the map canvas. To the left you should see the
Layers and Browser panels. You should also see the Toolbars below the menu above
the map canvas.
2
Introduction to GIS
We are going to be adding data from multiple sources onto our maps. To keep things
simple, it’s best to keep all the data in one place which is accessible. So, in your UL
OneDrive, create a new folder called GY4006 GIS. This will be easily accessible from
the computer labs and the Student Remote Desktop, and you can install OneDrive and
access it on your own laptop or PC if you want to use QGIS on your own device.
When the email arrives (it should be quick), click on the link to download a zip file.
A zip file is a compressed archive file which can contain multiple files, stored in such a
way that it reduces their size for storage or downloading. Before using the files stored
in the zip archive, you must extract (or ‘unzip’) the contents. Extract the contents of this
zip archive to your GY4006 GIS folder.
You will see there is a folder called Shapefiles containing 16 files. This data is in a
vector format known as a shapefile. This data format uses multiple different individual
files to store the complete dataset: you can think of this as one main .shp file which
contains the co-ordinates, and additional files which describe what those co-ordinates
mean.
Go back to QGIS and look at the Browser panel. It lists the files and folders on your
computer (and below that, connections to database and web servers; we aren’t using
these connections right now). In the file tree, if you click the arrow beside a drive or
folder it will expand to show the contents. Expand the file tree to find your GY4006 GIS
3
Introduction to GIS
folder (Home folder then OneDrive). Right click on the folder and choose Add as a
Favourite to make the folder easier to find in future. Expand the Rivers and Lakes
Shapefiles folder; you will see two shapefiles, WATER_RivNetRoutes.shp and
WFD_LakeSegments.shp. First, right click on WATER_RivNetRoutes.shp and choose
Add Layer To Project.
You will now see WATER_RivNetRoutes listed in the Layers panel, with a line beside it,
to indicate that it is vector line data. You will also see the data in the map canvas – all
the rivers in the 26 counties.
Now add WFD_LakeSegments in the same way. This data should also be displayed now
in the map canvas, and you should see WFD_LakeSegments listed in the Layers panel,
with a coloured square beside it, indicating vector polygon data.
Before doing anything else, you should save the project. From the menu, choose
Project > Save As. Navigate to your GY4006 GIS folder, and type a filename e.g.
IrelandFlooding. Click Save.
4
Introduction to GIS
If this opens what looks like gibberish in your browser instead of downloading, go back
and right click on the Download button and click Save Link As to download it.
If you get an error saying download.json can’t be downloaded securely, click the up
arrow and choose Keep – that’s just the browser not being used to this file type.
Save the file to your GY4006 GIS folder (if it saves to your Downloads folder by default,
move it to your GIS folder). This data is in a vector format called JSON, which stands
for Javascript Object Notation. This is a very common format for sending data over the
internet. The new JSON file should appear in the Browser panel in QGIS. Click on the
file in the Browser panel and drag it into the map canvas to add it to the project. You
should now see this listed in the Layers panel, with a dot beside it, indicating vector
point data. Right click on this layer and choose Rename Layer, and give it the name
OPW.
Save the project (Project > Save, or use keyboard shortcut Ctrl-S).
You can find this file on Sulis, named GY4006_Areas.gpkg. Download and move it to
your GY4006 GIS folder.
Find the GY4006_Areas.gpkg file in the QGIS Browser panel, and drag it to the map
canvas to add it to the project.
You have now added all three types of vector data – points (the OPW monitors), lines
(the rivers), and polygons (the lakes, and the areas of interest). Vector data is defined
by co-ordinates: one co-ordinate is a point. If you have multiple co-ordinates, that
could be either a line (if they’re all linked with a start point and end point) or a polygon
(if they’re all connected without a start or end point). We’ll work with other data types in
future weeks.
Right now, you can get kind of a sense of Ireland (at least the 26 counties) from the
river network, but if you zoom in you’re not going to know where you are. It would be
really useful if we could have a base map, just so we can see where we are! Luckily, we
can get this pretty easily, for the whole country even, without having to download it –
but we have to add a plugin to get it. Plugins are optional add-ons to the main QGIS
5
Introduction to GIS
software. From the menu, choose Plugins > Manage and Install Plugins. In the search
box, type QuickMapServices; choose it from the list, and click Install Plugin.
When it’s done, click Close. Then, from the menu, choose Web > QuickMapServices >
Settings. In the Settings window, click on the More Services tab, and click Get
Contributed Pack.
Click OK on the confirmation, and Save to close the settings window when done.
Now, from the menu, choose Web > QuickMapServices, and you will see a large
number of options. From the list choose Google > Google Road.
6
Introduction to GIS
A Google Road layer will appear at the bottom of the Layers panel, and you will see the
basemap in the map canvas – where it’s not covered by the vector data you’ve added.
You now have all your data added, and your map should look something like this:
We now have a map showing Ireland, plus vector data for rivers, lakes, and water level
monitors. You might be wondering why we bothered to get separate layers for the
rivers and lakes if we can just look at them on the basemap. The answer to that is that
while yes, we can look at them on the basemap, we can’t do anything more than look.
Having separate data layers for them means we can do things with them.
7
Introduction to GIS
The main topic of this week’s lecture is different map projections and co-ordinate
reference systems (using the example of the Irish Grid and ITM). Some of you will be
doing this before the lecture, and will unfortunately have to wait for that to understand
it more fully, but the main point is that the Earth is not flat, it’s round, and it is not easy
to show a round surface as a flat map. There’s several different ways of doing it, and
they produce results which can be very different from each other.
There’s also many different co-ordinate systems: the global GNSS (GPS) system uses
latitude and longitude, but those are measured in degrees, and how long is a degree?
They’re tricky to use locally if you’re interested in calculating distances, areas etc.
Instead, many countries have defined their own national grids, usually with co-
ordinates measured in metres – which is much more intuitive.
Now is the point we have to consider this in QGIS. Ideally, you want your map to be
using one system, and all your layers to have coordinates using the same system.
Hover the cursor over the OPW layer, in the Layers panel. You’ll see a popup appear,
which contains the text “OPW (Point – EPSG:4326)” and the location of the file.
“Point” tells you that the file contains vector point data. EPSG codes are codes for co-
ordinate reference systems (CRS) – so the data for this layer is saved in co-ordinate
reference system EPSG:4326. This is the WGS84 global latitude-longitude co-ordinate
reference system, which is used by the GNSS (GPS) system.
Now hover the cursor over WATER_RivNetRoutes in the Layers panel. You’ll see the
popup with “WATER_RivNetRoutes (MultiLineString – EPSG:29902)”. MultiLineString
tells you this is vector line data, with multiple lines. This CRS is the old 1965 Irish Grid –
why the EPA is still using this, I have no idea; someone needs to tell them the 90s
called and want their co-ordinate system back.
Finally, if you hover over GY4006 Areas in the Layers panel, the popup will be “GY4006
Areas (MultiPolygon – EPSG:2157)”. MultiPolygon should be obvious now – vector
polygons, with multiple polygons. This CRS is the current Irish Transverse Mercator
(ITM) co-ordinate system which is the current standard system for mapping in Ireland.
This is the CRS we want to use throughout the project.
Now look at the bottom right corner of the screen – you should see EPSG:29902 listed
there. This is the Project CRS – the co-ordinate reference system used in the Map
Canvas. It’s currently set to the 1965 Irish grid, because that’s the CRS used by the first
data we added.
The Layer CRS is what projection the file is saved in. The Project CRS is how the map is
drawn in the map canvas.
I want to demonstrate how big a difference the Project CRS can make. So, from Sulis,
download the files Albers ESRI102013.gpkg, Lambert ETRS89.gpkg, and Plate Carree
EPSG32662.gpkg from Sulis, and add them to your map. Each of these layers is named
for the map projection they’re saved in.
Now, zoom out until you can see the whole of Europe. One by one, right click on each
layer in the Layers panel, and choose Set CRS > Set Project CRS From Layer. You’ll see
8
Introduction to GIS
the map on screen change, quite significantly in some cases. Notice particularly how
Ireland looks each time. (If you want to play around with this more, and look at different
projections, doubleclick on the EPSG code in the bottom right corner of the screen to
open the Project CRS options.)
Since we’re working on data just from Ireland, the CRS we want to use is ITM, Irish
Transverse Mercator, EPSG:2157. This is easy to do, since we have a layer using ITM.
Set the project CRS from GY4006 Areas in the Layers panel. Ireland will be a bit
zoomed out now, so right click on the rivers layer, and choose Zoom to Layer to zoom
back in.
You may noticed that when changing the project CRS, although the data looks
different, the relative positions of all the different data stays the same. This is because
QGIS does something called projecting on the fly – if data is imported in a CRS different
to the project CRS, it reprojects it to the project CRS for display on the screen. This is
fine for just looking at data. However, it’s really intensive, so if your computer seems to
be getting slower, that’s probably why. For any data processing, we would ideally have
to reproject (resave) all the data into one CRS. We won’t do this just yet, but will be
doing some of that later. Save the project before continuing.
Now, let’s be honest, the map looks like a bit of a mess right now. We have to do
something about that. It’s time to introduce you to vector symbology.
9
Introduction to GIS
(QGIS randomly assigns every feature in a vector layer to be the same random colour
until you set something different, so you will very likely see a different colour here to
start with, instead of the red shown here.)
Click on the coloured Color bar to open the Select Color window.
Feel free to play around with this for a bit, to see what
options are available – a handy feature I use a lot here is
the option to add colours to the panel at the bottom, so
that I can re-use the same colours in other layers.
Lucky for us, the EPA included some data with the co-ordinates which tells us
something about the size of the rivers. Let’s look at the data the EPA including with the
co-ordinates. Right click the WATER_RivNetRoutes layer, and choose Open Attribute
Table.
Each row in this attribute table corresponds to one river segment. Have a look at the
different columns of data. The first, OBJECTID, is a unique identifier number for each
river segment. There’s also the name of the river, EPA_NAME; and a column of numbers
labelled ORDER_.
10
Introduction to GIS
Close the attribute table. Right click on the WATER_RivNetRoutes layer, and choose
Properties and Symbology.
In the central panel, you should now see 8 different coloured lines, labelled 1-7 and all
others. By default, QGIS gives each of these a random colour. If you click the dropdown
beside Color ramp, you can choose different sets of colours. Again, feel free to play
around with this a bit to see the possibilities, and choose a set of colours you think
would be appropriate for the rivers.
11
Introduction to GIS
Now, let’s look at the layer for the OPW monitors. We want the location of the water
level monitors, but the OPW actually has sensors monitoring more than just the water
level, so there are too many points here.
Lucky for us, the OPW has included an attribute for each point to tell us what type of
data is recorded by that monitor. Open the attribute table for this layer by right clicking
on it and choosing Open Attribute Table.
For each point, we have a station reference number, station name, sensor reference,
region ID, and more. You’ll see the same station reference numbers and names
appearing a few times, because there’s multiple sensors at each monitor station. The
attribute we want to use is sensor_ref – I’ve checked, and the ones with a value of 0001
are the water level sensors. We can use this to select all the points with this attribute.
12
Introduction to GIS
selected (the number might change a bit depending on how many sensors are working
on the day you do this).
The data in the map canvas should not look any different. Selected features are usually
shown in yellow – but in this case, there are points for other sensors at the same points
(0002, 0003, and 0004) covering the selected features, so we can’t see that.
If you open the attribute table for the new layer, you should see only 4 columns, and
sensor_ref should be 0001 for every row of data.
We don’t need two OPW layers, so right click on the original OPW water level layer, and
choose Remove Layer. Click OK on the Remove Layers and Groups popup to remove
the layer.
13
Introduction to GIS
The map should now be looking a lot better, but again there’s no way you could feasibly
analyse the entire map area. It’s time to focus on your own area.
The data for all the individual areas is in the GY4006 Areas layer. If you open the
attribute table for this layer, you’ll see each shape has two attributes: an area number,
and a student ID. Your ID will be in this list (if it’s not, you better get in touch with me –
and Academic Registry! – pretty quickly).
Now you need to save your area as a separate shapefile, just as you did for the OPW
sensors. Right click the GY4006 Areas layer in the Layers panel, and choose Export >
Save Selected Features As. Click the Browse […] button beside File name, navigate to
your GY4006 GIS folder, and type a filename AOI (this stands for Area Of Interest).
Make sure the checkbox beside Add saved file to map is ticked. When ready, click OK
to save the new layer, and you should see it appear in the Layers panel.
You no longer need the full GY4006 Areas file, so you can right click on it and choose
Remove Layer. Save the project.
Now, your area is a separate shape. However, it’s a solid block of colour – which isn’t
much good if you want to see what’s in your area. We need to change how it’s
displayed. Ideally, we want it to be an outline, with no colour fill.
14
Introduction to GIS
Now you should be able to see the data within your area. Right click on your AOI layer
in the Layers panel, and choose Zoom To Layer to zoom in on your area.
Now, if your area is in, say, Carlow, then the rivers in, say, Donegal are not exactly
relevant for you right now. You want to concentrate on the data that’s within your area.
Shortly, we’re going to do that – cut out all the river and lake and monitors data that’s
not relevant to you. However, the rivers and other data which might be of interest to
you doesn’t stop sharply at the borders of your area - it’s always good to think about
what’s just outside, for context.
If there is not an OPW monitor in this buffered area, you should create a new, larger,
buffered area, so that the closest relevant OPW monitor is included within the buffer
area. For some areas with a monitor, 5km might be too big – feel free to go smaller.
When you have a buffer area you’re happy with, you need to do two things. First, save
the buffer layer. Right click on the Buffered layer in the Layers panel, and choose
Export > Save Features As.
15
Introduction to GIS
(One potential issue here – sometimes the newly saved Buffer layer will have a symbol
with a question mark beside it in the layer panel. Hovering over this symbol will show a
warning that the layer has no associated CRS. If this happens, click the symbol, type
2157 into the search box, select EPSG:2157 – IRENET95 / Irish Transverse Mercator,
and click OK. This should solve the problem.)
This buffer layer is useful to have – we’re about to use it in the next task – but it’s
certainly not useful to have it covering your area of interest in solid colour, hiding the
only part of the map you should be focusing on! You could change how the AOI Buffer
layer is displayed using Properties and Symbology, in the same manner as you did for
your area itself – but honestly, it doesn’t need to be visible at all. Click the check box
beside the AOI buffer in the Layers panel – this will turn off display of the layer. It now
exists, but it’s not shown on the map.
Now, we’re ready to cut all of the river, lake, and monitor data that’s not useful for your
area of interest.
16
Introduction to GIS
Right click on the Clipped layer in the Layers panel, and choose Export > Save Features
As. In the Save Vector Layer as… window, make sure Format is set to ESRI Shapefile,
and CRS is set to EPSG:2157 IRENET95 / Irish Transverse Mercator.
Click the Browse […] button beside File name, navigate to your GY4006 GIS folder, type
Rivers as the File name, and click Save. Click OK to save the new layer.
You should see the new Rivers layer in the Layers panel, and you can remove the
Clipped scratch layer now.
Then, right click on the new Rivers layer, and choose Styles > Paste Style > All Style
Categories. The new Rivers layer should now have the same styling as the full layer, but
with only the data in your area.
You no longer need the WATER_RivNetRoutes layer, so you can remove it.
Repeat the Clip process for the WFD_LakeSegment layer, calling the new layer Lakes,
and for the OPW Water Level layer, calling the new layer OPW Water Level Monitors.
You should now have a map with a Google Maps basemap for the whole country, with
your area of interest shown, and the rivers, lakes, and OPW Water Level monitors
shown only as far as the buffer zone around your area. And all of the layers should be in
the EPSG:2157 IRENET95 / Irish Transverse Mercator CRS. Right click on your AOI
Buffer layer and choose Zoom to Layer to see it up close.
17
Introduction to GIS
Final Thoughts
You took found and raw data from multiple different sources, edited it to display the
right way, edited it to display only what was needed, changed what it looked like, and
arranged it into a usable map. That’s an incredibly useful skill to be able to have – even
if you’re not going to be a full time geographer.
Imagine you’re a teacher, taking a class on a trip. If you can get map data for the area –
and you usually can – you can use this process to make a map of the place you’re going
to for the students.
Now, it’s a bit of a stretch to say you’ve learned how to do it – you’ve followed a step by
step guide. It’s different when you’re doing it without instructions. But now you know
some of what can be done, and it’s not such a stretch to be able to do it again. The
most important thing is that you know what’s possible – and so can easily google “how
do I do X in QGIS”. Often, that’s the most important thing, just knowing what to google.
If you really want to get to grips with this, play around with all the options. The only real
way to learn QGIS – or any software, for that matter – is to get stuck in and try it. So
messing around with all the menus and options will get you learning it faster than
anything else. Just try things, and see what they do.
Now, it is worth pointing out that this was just an exercise in displaying data. We didn’t
use QGIS to do any analysis of the data. We also just used vector data. Our next
exercise will involve some raster data and data processing.
18