data visualisation with qgis

38
Data Visualisation with QGIS Written and Presented by Tom Armitage EDINA, University of Edinburgh

Upload: others

Post on 19-Jun-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Visualisation with QGIS

Data

Visualisation

with QGIS Written and Presented by Tom Armitage

EDINA, University of Edinburgh

Page 2: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

2

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

SETTING UP QGIS FOR THE WORKSHOP For the workshop today we need to add a few plugins and you should set the projection we

will be working in. You will only ever need to add plugins to QGIS the first time you use it.

Equally you can set a default map projection to match your most commonly used data.

PLUGINS:

Click on the Plugins list at the top of the screen and go to Manage and Install Plugins. The

ones we need today are QGIS2threeJS, QuickMapServices and TimeManager. We will also

be using the Heatmap plugin but this is installed by default with QGIS , you may need to

switch it on though if you haven’t used it before .

COORDINATE REFERENCE SYSTEM: Today we will be using data from several different Projections and Coordinate Reference

Systems (CRS) so we need to prepare QGIS for this.

• Click on the bit at the bottom right of the map, where it says EPSG: xxxx

• Enable the “Enable ‘on the fly’ CRS transformation” option

The map will pick up the CRS of the first dataset we add and then we may be asked each

time we add further datasets which CRS they are in.

ADDING A WEB BASEMAP The first dataset we are going to use is

a global dataset so we need a global

basemap to display it on. The

QuickMapServices plugin will allow us

to pipe one straight from the internet

into the GIS.

• Click Web at the top of the

screen

• Select the Search QMS from

QuickMapServices

Page 3: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

3

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• Type “Dark” in the search box of the

Search QMS that has opened on the left of

the map.

• Double Click on the Dark Matter option

• The map should appear in the main

window

You will now have a dark world map, just right for adding highlighted data:

Page 4: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

4

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

CREATING A PROPORTIONAL SYMBOL MAP Creating proportional symbol maps in QGIS is made very easy in QGIS with two main methods for

making them. You can use basic Single Symbol style with the Size Assistant in the Data Defined

Override, or you can use the Graduated style and choose Size as the method of gradation. Below is a

set of instructions on how to use both methods to create proportional point symbols for your map.

METHOD 1: GRADUATED SYMBOLS This method works best when you want to use all the points in your dataset. QGIS allows you to vary

the size of the data point based on the values in attributes of the data.

• Add the ne_10m_populated_places.gpkg data to your map.

• Press F7 to open the Layer Styling Panel on the right-hand side of the map.

• Change the colour of the point symbol to be pure red.

Make sure the top menu of the layer styling tab is set to the Natural Earth Point data, then

change Single symbol to be Graduated.

There are now a few new options to play

with:

• Change Column to be pop_max

• Change Method to Size

• Change “Size from” to 3 and

“to” to 20

• Click the Classify button to see

how this looks.

Page 5: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

5

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

The map will automatically update to look like the map show below, zoomed in to the UK and

Northwest France:

You have flexibility to change the number of classes and how you divide the classes, Equal Interval,

Quantiles, Natural Breaks etc. You can also manually edit the classes by double click in the values

column in the table.

METHOD 2: DATA DEFINED OVERRIDE If you want a little more control over how the data is displayed this method allows you to quickly

change maximum and minimum values to use in the data without having to set each level in between.

• Right click on the ne_10m_polpulated_places in the Layers Panel and click Duplicate

• Uncheck the ne_10m_populated_places in the Layers panel and check the new

ne_10m_populated_places_copy so this is the only one visible.

• Make sure the top menu is set to …copy.

• Set the symbology back to single symbol.

• Click on the Data Defined Override button on Size

Page 6: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

6

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• Click on the Size Assistant option at the bottom of the box.

You will now be looking at the Size Assistant dialog. The options here are very similar to using the

method described above, allowing you to select the field to base the size on and having control over

size of the points.

• Set the Field to be POP_MAX

• Set the Scale method to be Radius

• Change the “Size from” to be 3 and “to” to be 20

Page 7: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

7

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

As you can see in the example above the symbols automatically scale from the smallest to the largest

values in the field selected. However, where this method has a big advantage over the previous one

you can set the upper limit to be different. The points will now automatically scale to this value without

you having to manually update each range. This can be very useful if you are viewing only a portion of

the data.

In the area we zoomed to in the previous method the largest cities are London and Paris, both having

a population of below 10,000,000

• Change the “Values from” to be 0 and “to” 10,000,000

Page 8: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

8

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

You can now see in the map below there is a bigger range of point sizes than the previous method for

the area of the map.

BLEND MODES A little added tip is to use the blend modes on your symbology, so you can see the basemap through

the shapes and reveal the detail on any overlapping symbols:

• First, we need a visible boundary on the points, change the outline to be white.

• In the Layer Rendering section of the style tab change the Layer blending mode to be Screen.

This will allow you to see the basemap through the points

• Change the Feature blending mode to be Screen. This will allow you to see overlapping points

within the point dataset.

Page 9: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

9

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

THE RESULT:

Save your QGIS Document and we’ll move on to the next section.

Page 10: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

10

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

CREATING A 3D PRISM MAP 3D Prism maps are an Ideal way to represent 2 different features at the same time. In this example we

are going to use the same cities data but vary the diameter of the points by the area of the city and

use the 3D dimension to represent the population. We are going to make a map of Australia this time.

• In the style panel open up the data defined override for the …copy data and go back to the

Size assistant.

• Change the POP_MAX to be MAX_AREAKM

• Change the Size to be 2 to 15

• Change the Values to be 0 to 1554 (the largest area of a city in Australia, Melbourne)

• Before we go back to the map change the outline to be transparent so there aren’t a lot of

white circles on the map.

Zoom and pan to Australia, try and get just Australia on the map, it should look a little like this:

Page 11: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

11

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

ADDING SOME DRAW EFFECTS. To add a little extra impact to the map we can add some draw effects. As the symbols overlap and we

don’t want it to get too busy we need to add the effect to the layer not the individual features.

• Switch on the Draw Effects by checking the box in the Layer Styling panel and then open them

by clicking on the Yellow Star:

• Check the Outer Glow box.

• Click on the Outer Glow to open up

the options:

o Set the Spread to be 2

o Transparency to be 50%

o Set the color to be Red

Page 12: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

12

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

The map now has a bit more character, and we can get to work on adding the 3rd dimension. TO do

this we are going to use the QGIS2THreeJS plugin.

The plugin can be found in the web menu in the top bar of QGIS:

Page 13: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

13

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

There are a whole raft of options to look at with this plugin as it can be used not only for Prism Maps

but for accurate 3D landscape models too. We’ll run through the changes needed to make a Prism

Map, the rest of the parameters can be left as the default settings.

Well start at the top of the menu on the left:

WORLD

The only thing to change here is the Background colour. The default is sky which works well for

landscapes but I have set this to black which works better for the colours of this map.

CONTROLS This can be left as the defaults.

Page 14: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

14

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

DEM

The only thing to change here is to scroll down and switch off the Build Sides and frames options.

ADDITIONAL DEM This can be left as the defaults.

Page 15: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

15

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

POINT

This is where we need to make the most changes:

1. Check the cross next to the …copy layer

2. Set the Object type to Cylinder

3. Set the Radius to be “MAX_AREAKM” with a multiplier of 100

4. Set the Height to be “POP_MAX” with a multiplier of 0.2

WE can let this run to a temporary file but if you want to save the output to a permanent location

you can do this at the bottom of the interface.

• Click Run

• The map should automatically open in your default web browser complete with the controls

to navigate it in 3D.

• Use the mouse wheel to zoom in and out

• Click and hold the left mouse button and move it to shift your point of view of the map

• Click and hold the right mouse button and move it to shift the map from your point of view

At the top right of the map is a layer control use it to make the cylinders semi-transparent:

• Open the Layers menu

• Open up the …copy section

• Set the opacity to be 50%

The map will now look like the one overleaf.

Page 16: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

16

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

The height of the columns represents area and the diameter relates to the footprint of the city.

You should be able to tell that Sydney is a more densely populated than Melbourne as it’s column is

taller and narrower.

Page 17: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

17

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

CREATING A HEATMAP We are now going to look at some earthquake data so save your cities map and create a new map

document.

• Add the earthquake.gpkg dataset.

• Add the ne_10m_Land.gpkg dataset.

• Style the ne_10_Land.gpkg to have grey outlines and fill,

o 50% “V” for the outlines

o 75% “V” for the fill

Now we can start styling the earthquakes:

• On the Layer Styling panel, make sure the earthquakes dataset is the one highlighted.

• Change the top drop down from Single Symbol to Heatmap

• Change the colour ramp by clicking on the Edit button to the right of the drop down

• In the Gradient color ramp window set Color 1 to be transparent and set Color 2 to be red.

o Use the drop down arrow next to the colour swatch

At the moment the transparent colour is black, which will give a faded black halo around our

heatmap points. To make it look better we should set the transparent colour to white.

• Click on the transparent (checkerboard pattern) swatch next to Color 1.

• In the Select ramp color change the HTML notation value to #ffffff.

• Once you have selected a white colour click OK

With the zero values being completely transparent we won’t be colouring the entire map, just the

areas around where there are earthquakes.

Page 18: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

18

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

We are now going to add in a second colour to the color ramp.

• Double-Click under the gradient just to the right of the arrow at the transparent

end to add a stop at around 5%.

A new arrow will appear, click on it to edit the colour and position.

• Change the relative position to be 5%

• Change the color to be Yellow

• Change the Opacity to 100%

• Click OK

Back in the Heatmap Settings:

• Set the Radius to be 7.

• Set Weight points by to mag.

• Set the Rendering quality to Best by

dragging the slider to the left.

• Set the Layer rendering → Layer

blending mode to Multiply

The “Multiply” blend mode allows us to see the

basemap through the heatmap.

The results show the areas where earthquakes

are most likely to occur:

Page 19: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

19

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

Page 20: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

20

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

USING TIME MANAGER TO CREATE AN ANIMATED MAP We can use this plugin to animate the data breaking it up into time periods and then creating a map

for each section of time. These can be strung together to create an animation.

• First, close the style doc so we have more map on screen.

• Now we need to switch on TimeManager, it will be at the bottom of the Plugins Menu.

You should now see a set of controls at the bottom of the map:

• Click on the settings button in the new tool bar below the map to begin setting up the

animation.

• Click on the Add layer button:

o Set the layer to be earthquakes

o Set the Start time to be Date

o The rest should be the defaults below:

Page 21: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

21

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• Click OK.

The Time Manger setting should now look like this:

• Click OK.

We now need to set up Time Manager to slice the data, it only contains major earthquakes so the

data has only a few thousand points. To get maps that don’t look like random spots we’ll need to

group them into decades.

Page 22: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

22

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• Set the Time frame size to 10 Years

• Switch on the plugin using the “power” button, it will turn green when it is on:

• Click the play button

The map sequence will play very slowly in QGIS, but if you click the Export Video button it will

output a PNG file for each map. These can be stitched together very easily into a video in a range of

different software: Windows Movie Maker, Blender etc. Linux and OSX users can output a video

directly from QGIS.

Page 23: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

23

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

ADVANCED DRAW EFFECTS. In this next section we are going to explore the same earthquakes data and create a “Firefly” map of

the points. Credit for the idea goes to John Nelson, one of Esri’s top cartographers. I wanted to

recreate his map using QGIS and after some time playing around with many different techniques this

is a good replica. It is possible to do much better in QGIS but I like the simplicity of this solution

compared to the relatively complex original process in ArcGIS.

SET UP THE MAP

• Switch off the Time Manager plugin using the green power button:

• Now close the plugin using the cross in the right-hand corner below the map.

We are going to start a new map with a raster backdrop

• Click on the New map button

• Click Project at the top right of the QGIS interface and select Project Properties.

• Change the Background color to be Black

We are now going to change the projection to give a more globe like view:

• Click on the CRS tab

• Enable on the fly transformations

• Filter with 53009 and select Sphere_Mollweide

Page 24: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

24

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• Click Add raster and then add in the World.tif file

• Click OK

The map will now look like this:

We are going to add some bright glowing earthquake points to this map so we need to dim down

the colours. In the Layer Styling panel:

• Reduce the Brightness to -15

• Reduce the Saturation to -50

• Switch on Colorize

o Change the colour to Grey (65%)

o Change the strength to 50%

We can now add the earthquake data back in to show up on this dark globe.

Page 25: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

25

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

Use the Add vector data button to bring back the earthquakes.gpkg data.

On the Layer Styling panel:

• Select the Earthquakes layer

• Set the Unit to Pixels

• Click Simple Marker

• Set the fill to be white

• Click on the Data Defined Override

button

• Select Size assistant

• Set the Size from and to, to be 1 to

10

• Click OK

• Set the Outline Style to be No pen

Your Style tab should look something like

this:

…and your map should now look something like this:

Page 26: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

26

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

Now we have our base to work from we can now start to add some draw effects to the features to

make them stand out:

Turn on the draw effects above the layer rendering panel NOT the one in the layer rendering section:

Then click on the yellow star:

We are going to add 3 outer glows and a blur to go with the source:

• Click to activate the existing outer glow and then click again to highlight it so that you can

edit the options.

o Change Spread to 5

o Change Millimetres to be Pixels

o Change Blur radius to 3

o Change the transparency to 75%

o Change the Single color to be HTML Notation #ffffbe

• Click the green plus to add a new effect

• It will come in as Source so change it to Outer Glow

• Use the blue arrow to move it to just below the last outer glow.

o Change Spread to 10

o Change Blur radius to 5

o Change the transparency to 75%

o Change the Single color to be HTML Notation #d1ff73

• Again, click the green plus to add a new effect

Page 27: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

27

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• Change Source to Outer Glow

• Use the blue arrow to move it to just below the last outer glow.

o Change Spread to 15

o Change Blur radius to 16

o Change the transparency to 80%

o Change the Single color to be HTML Notation #00c8d6

Finally we are going to add a blur effect to soften the original white dots:

• Click the green plus to add a new effect

• Change Source to Blur

• Use the blue arrow to move it to just below the Source.

o Change Blur type to Gaussian

o Change Blur strength to 4

o Change the transparency to 25%

Your map should now look a like this:

We need to add a blend mode to make the data points not overwrite each other in this way. Before

we do this the map looks at his best at zoom levels around 1:50 million, so zoom in on Australia first.

• Change the Feature blending mode in the layer rendering section of the simple marker to

be lighten.

One final trick we can use to soften the edges of the larger dots is to add a little flare to them.

• Right-Click on the Earthquakes layer in the Layers Panel

o Click Duplicate

• Move earthquakes copy above the earthquakes layer in the Layers Panel

• Right-Click on the earthquakes copy and rename it earthquakes flare

• Right-Click again and go to the earthquakes flare → properties.

Page 28: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

28

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

• On the Style tab, go to the bottom and click Style → Load Style → Load from file

• Choose the flare.qml from the data folder.

• Click Open.

• Click OK to go back to the map

• Check the box to turn on the Earthquakes Flare layer, your map should now look like this:

As I said at the start of the exercise, the map can easily be improved upon, but it is nice to see that

you can get such a great looking style with so few layers, relatively few processes and with no

reliance on any other software.

Page 29: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

29

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

EXTRA EXERCISE: DOT DENSITY MAPS If you have managed to get through all the previous exercises here is another one you can try out!

DOT DENSITY MAPS: These maps display the density and distribution of a phenomena over a geographic area. The

markers, usually a dot or cross, represent the occurrence or an aggregation of occurrences which are

then randomly distributed across distinct regions of the map. Colours can be used to represent

different classifications to add an extra dimension to the map.

The example above shows votes to remain (red) and leave (blue) the European Union in the London

Boroughs. Each dot represents 100 votes and these have been randomly scattered within each

borough to represent the density of votes.

THE DATA For this exercise we are going to use a geopackage which contains the outlines of the London

Boroughs. The attributes of the boroughs include the number of votes to remain and the votes to

leave the EU. The data is in the folder you have been provided with.

• Add the LondonBoroughEURef.gpkg to a new map.

• If it doesn’t automatically update change the CRS to be British National Grid EPSG: 27700

Contains OS data © Crown copyright and database right (2017)

FIELD CALCULATOR Before we can start generating the dots on the map we need to create a column with a reduced

number, as there were too many votes cast to give each one it’s own dot. To do this we will use the

field calculator to create new attribute columns with the numbers of votes each way divided by 100.

• Right-Click on LondonBoroughEURef in the table of contents and select Open Attribute

Table

• Click on the Open Field Calculator button above the table:

• You will need to set up the Field Calculator as follows:

Page 30: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

30

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

1. Make sure the Create a new field option is selected and enter the name 100 Leave Votes.

2. Make sure the Output field type is set to Whole number (integer)and the Output field

length can be left at the default 10.

3. The expression needs to be: “Vote_Leave” / 100 you can user the Fields and Values section

to the right to make sure you get the right field names and quote marks, just double click on

the field name you want.

4. Click OK.

Now repeat this process to create a similar column for the remain votes, call the column 100 Remain

Votes. The table should now look like this:

Page 31: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

31

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

Click Save edits then toggle out of Edit mode

RANDOM POINTS Now we have the reduced quantities we can use QGIS to randomly assign points across each area.

Select the Random points inside polygons (variable) from the Vector > Research Tools menu.

Fill in the values as follows:

Page 32: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

32

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

1. Although we are making a density map we are going to use the Points count Sampling

strategy. This will assign the number of points in the Number field to each polygon.

2. Choose 100 Leave Votes to be the Number field. Don’t choose Votes_Leave or Votes as you

will then be creating a huge number of points in each polygon!

3. Set a Minimum distance of 1 – 10 (map units, metres in this example) It is good to not have

the points overlapping but not essential as we will mitigate this at a later stage. If you set

this too high there may not be room for all the dots in the smaller boroughs.

4. Save your file as a new Geopackage (or shapefile if you want to). These files will be quite big

so it is best not to create a temporary layer.

5. Click Run. It will take a while as the algorithm has to cycle through the 33 boroughs.

Once the process has finished you will have points all over the map within the boundaries of the

London Boroughs. However the new layer added will be called Random Points in the layers

panel. We will need to change this before we create a similar file for the votes to remain.

• Right-click on Random Points in the layers panel.

• Click Rename and change the name to be 100 leave votes.

Now rerun the Random points inside polygons (variable) for the remain votes. Use the same process

as above, but use 100 Remain Votes as the Number Value, call the new geopackage Remain Dots,

and finally rename the layer in the layers panel to be 100 remain votes.

The map will now look something like this:

Page 33: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

33

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

STYLING THE MAP As it stands this map is rather useless, the points are all overlapping and you can’t see the leave

votes as the remain all lie over the top of them. Thankfully we can use the power of QGIS to style the

points in a way that makes gives equal emphasis to dots from each layer.

First lets style the London Borough polygons so that they don’t interfere with the dots.

• Click on the LondonBoroughsEURef in the layers panel to highlight it and then press F7 on

your keyboard to open the Live Style Dock on the right side of the map.

• Click Simple Fill at the top of the Layer Styling panel.

• Change the Fill to Transparent.

• Change the Outline Width to be 0.6

The Outlines will now be clear but there will be no fill colour to interfere with the dots. We can now

move on to styling the points.

We need to reduce the size of the points so the map isn’t too crowded and give them a good colour.

We also need to set a blend mode to account for any over lapping points.

Page 34: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

34

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

1. Use the drop down menu at the top of the Layer

Styling panel to change the layer to 100 Remain

Votes.

2. Click Simple Marker to reveal more options.

3. Set the Size to be 0.6 (MIllimeters).

4. Set the Outline Style to be No Pen.

5. Set the Layer lending mode to be Multiply

6. Set the Feature blending mode to be Multiply

7. For Fill, click on the colour swatch.

We want to set this as red but we want to take down the saturation. This is to allow overlapping

features to have a stronger colour; either a strong red where two features in the same layer are

blended or a purple where there is overlap with the blue leave dots.

By picking colours of the same intensity we have also made sure that the map has minimal bias to

one colour or the other. This is also maintained by the use of the Blend modes which mix into purple

and so minimise the bias where one dot may have overlapped another of a different colour.

On the colour chart:

1. Set R(ed) to be 255 (Full) and G(reen) and B(lue) to be 0.

2. Go up to S(aturation) and bring this down to 70% making the red lighter. You will notice that

the G and B values increase to 76.

The colour now has scope to increase its intensity if it overlaps with another dot.

Page 35: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

35

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

Repeat the process above with the 100 leave votes layer except here we are going to use blue. Just

make sure you increase B(lue) to 255rather than R(ed) when selecting the colour.

The map will now look like this, it works at scales between 1:200,000 and 1:400,000. You will need

to have less dots if you want to zoom out further, or more or larger dots on a more zoomed in map.

Contains OS data © Crown copyright and database right (2017)

So you should now be able to make the distinction between the largely remain voting central

London compared to the periphery where voting leave was more popular, particularly in the West.

LABELLING The final thing you can do to your map is add labels to the London Boroughs so you can tell which is

which. With such a busy map we are going to need buffers round the text.

Page 36: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

36

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

1. On the Layer Styling panel, change

to LondonBoroughEURef then switch to

the Labels tab:

2. Change to show labels for this layer.

3. Change Label with to NAME.

4. Choose a weightier font, I have

used Franklin Gothic Demi.

Next we need to work on the formatting of the text so click on the format tab:

1. Enter a space in the Wrap on Character

field.

2. Change the Alignment to Center.

The labels will now be better placed over the

boroughs, though there won’t be enough room

for them all unless you are more zoomed in.

The final steps are to add a mask or buffer to the text to make it stand out over the dots.

Click on the Buffer tab to start making changes:

Page 37: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

37

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

1. Click the cross to Draw text buffer.

2. I have left the Size as 1,but you may want to change this depending on your font.

3. Set the buffer’s Transparency to something like 33% to allow some colour to show through.

That is the end of the instructions, you should have a map that looks similar to the one below:

Contains OS data © Crown copyright and database right (2017)

Page 38: Data Visualisation with QGIS

Data Visualisation with QGIS, FOSS4GUK 2018

38

Written and Produced by Tom Armitage, EDINA. University of Edinburgh.

Thank you very much for working through this practical, if you have any questions or would like any

advice or further information then please get in touch:

• Email: [email protected]

• Website: http//:edina.ed.ac.uk

• Twitter: @MapNav_Tom

• LinkedIn: https://uk.linkedin.com/in/tomarmitagegeo