Land within cities is used for multiple, often overlapping purposes, the configuration of which is likely to have evolved over time. These uses may vary between day and night and may only be apparent to those familiar with these locations. Additionally, tracking population change over time is vital, though not always straightforward, as successive censuses have used inconsistent boundaries. Nevertheless, being able to summarise such information is highly beneficial for a range of stakeholder applications within cities.
This practical examines spatial trends in night and day time populations in Liverpool including various age groups. It also explores how employment and residential populations map onto physical space within the case study of Local Authority District. These analyses will assess the extent to which different industry types cluster within Liverpool, and how these attract workers from different areas of the city. The objective of this practical is to use GIS for an analysis of the socio-economic geography of Liverpool. The GIS analysis employs data from Ordnance Survey (OS), Census 2021 residential population and Workplace population based on the Census 2011.
You will also be developing the following GIS skills and understanding:
Let’s start by adding data to the map display. First, we add the Census 2021 population data for Liverpool Local Authority District at LSOA level
Population
by right
clicking on it and selecting Rename Layer.This will add a layer containing information about Liverpool’s Census
2021 population aggregated by Lower Super Output Area (LSOA).
QGIS has a number of different ways of navigating around spatial
data.
Explore the data by using some of the navigation tools such as Zoom In, Zoom Full and Pan Map
The Identify Features tool allows you to select an LSOA on
the map and see the attribute information stored in the shapefile about
that LSOA.
Click on any LSOA, a window will appear, titled Identify Results with information about the LSOA you selected e.g. the LSOA code or total population.
When we add a shapefile, QGIS randomly assigns a colour; you already know from the GIS practicals in Year 1 how to change the colour, so play around with different colours for a bit.
Right click on the Population
layer in the
Layers Panels and choose Properties >
Symbology option . Play with different options, explore various
colours, opacity etc.
Once you’re happy with your selection, click OK and this will close the Layer Properties window and update the colour on the map.
The options you have in this layer will depend on what type of spatial data you are dealing with. The `Population’ layer is a polygon layer, so we can change the colour of the polygons and their borders. Point layers or line layers will have different options.
When we work with a large number of datasets/layers it may be useful to group them in a logical way, so the Layers Panel appears less cluttered.
OS data
.Now is a good time to save the QGIS project file. It is highly recommended to save your work fairly often as QGIS can occasionally crash and your work may be lost.
To display the population of Liverpool we will use the
population
layer. At the moment we are displaying a map of
Liverpool’s LSOAs and there is no visible information about the
population distribution for example. However, it would be interesting to
display some spatial patterns, such as population distribution or
density at a small area level. Based on the skills gained in Year 1, you
should be able to display such information. Have a go at classifying the
population data. As the population dataset contains numerical data, a
function called Graduated is typically used, but for
categorical data the Categorized function is more
appropriate.
In case you’re not sure how to proceed, follow the steps below:
Population
layerAt this stage, the Symbology window should be filled
as on the picture below:
Now, we are going to change the default colour and adjust LSOA boundaries, so the map looks more professional.
Your map should now look something like the one below:
Go back to the Properties/Symbology window
Click on the Histogram button and then Load Values
Adjust Histogram bins value to 25
What does it tell you about the population distribution, is the data normally distributed or skewed?
Can you describe spatial patterns of population distribution in
Liverpool?
Is this more likely to be a day-time or night-time distribution - why?
How different classification modes (Jenks, St Dev) change the population distribution
Watch Lecture 2 and do additional reading to learn more about various classification schemes
You can get a summary of the population data by going to Vector > Analysis Tools > Basic Statistics for fields
Select Population as your Input layer and Total Pop as the Field to calculate statistics on, click Run. This approach provides a valuable method for obtaining descriptive statistics for any layer or specific selected values. These statistics can subsequently be incorporated into a table, which is an essential component of any scientific or commercial report.
Now, copy the Population
layer by right clicking on
it > Duplicate Layer
Rename the new layer to Working_age
Right click on the Working_age
layer then
Open Attribute Table > Field calculator and create a
new field called Work age where you calculate the total number
of those between 16 and 64 years old
In the expression window, type the following formula: “16 to 24 y” + “25 to 34 y” + “35 to 49 y” + “50 to 64 y”, click OK
A new field, showing the total number of working-age population, should be added to your Attribute Table
Save the edits (right click the layer > Toggle Editing > Save)
Then following the above steps to create a map of
Working_age
population distribution in Liverpool (Use
Work age as your Value to classify the
data)
How does the distribution of the Work age vary from the entire residential population? Check the histogram too.
The Census 2021 residential population data reflect the so-called night-time distribution, as many individuals commute to their workplaces during the day. In contrast, the concept of the daytime population refers to the number of people present in an area during regular business hours, including workers, as opposed to the residential population counted during evening and night-time hours. Now, let us examine the daytime population in Liverpool, as captured by the so-called workplace zones data. Start from loading up the relevant data:
WPZONE
layer and explore itThere is only one field called WZ11CD, which is a unique code for UK Workplace Zones. Importantly, there isn’t any population data attributed to the layer, so we need to add this information. As you may remember, this process involves joining a numeric table, which typically contains attributes or statistical data, to a spatial data layer that represents geographic features such as points, lines, or polygons. By linking the two, you can enrich the spatial dataset with additional information from the table, enabling further analysis and visualisation.
In order to join tabular data, it is necessary that both of your
datasets have a common attribute (e.g. a name, unique reference or
code). Can you identify the common field for the WPZONE
layer and WP102EW
table? If you open the
WP102EW table you will notice that the first field is
called WZ11CD, so you’re right - our join will be based
on that field.
Right-click on the WPZONE layer, select
Properties and click on the Joins
option
Click on the plus button to create a new join.
The Add Vector Join dialogue box will open
Make sure that WP102EW is selected in the Join layer dropdown box
WZ11CD should be selected in the Join field dropdown box
WZ11CD should also be selected in the
Target field dropdown box (as per picture below)
Hit OK twice
Open Attribute Table of the WPZONE
layer and you
will see that several new fields have been added to the Attribute table!
Please ask for help if this is not the case
So, now we should map the Workplace zones population, but there are two things that we need to do before. First, the join that we have made is not permanent. By now you should know how to make a join/layer permanent, so go ahead and do it. In case you’re not sure, follow the steps below:
WZ_population
Second, we need to rename the columns in the Attribute Table as the existing ones do not make much sense. You can get the relevant column names from the table called variables_description.csv, saved in your working directory/data/Workplace Zone. The top three variables are the ones you need.
To rename the variables follow the steps below:
There are various ways of renaming variables in QGIS. A tool called Refactor fields can be used, however, we will use a different method (using Field calculator), where we will create new columns and name them appropriately. Importantly, this methods also changes the type/format of the variables from text to numeric. This step is essential for creating a choropleth map.
The Field calculator is often used to interrogate spatial data and perform calculations based on existing attribute values or defined functions, e.g. to calculate length, perimeter or area of spatial features. The results can be written to a new attribute column or they can replace already existing values.
Important
Using the field calculator, we will also change the output field type to
numeric, as the numbers are currently saved in text format (.csv). It is
important to note that text fields cannot be displayed using a
‘Graduated’ scheme—text variables will not appear when you attempt to
classify the data. Converting the field to numeric ensures the data can
be properly visualised and classified for mapping purposes. Please
follow the steps below:
WZ population
layerWZ_pop
in the Output field
name box and choose Integer (64 bit) as your output
field type"WP102EW_WP"
or something
similar (this may vary depending on the version of your QGIS)WP102EW_WP
WP102EW_2
column too -
name it Density (use Decimal number (real),
set Precision to 2, if you can change it)You are now ready to create a choropleth map that shows the spatial distribution of the workplace zones population in Liverpool:
Create a choropleth map of WZ population by following the steps from Section 2.2.4
Use the WZ_pop column to classify the data and apply
Greens as the Colour ramp
Your output map should look something like the one below:
How similar the spatial distributions of the day and night-time population in Liverpool are?
Can they be directly compared?
Also, can you think of a location of the major employers in Liverpool such as the Universities, Hospitals, Airport or retailers? Is there any pattern?
In order to identify the major employers in Liverpool we will use the
FunctionalSite
layer from the OS dataset. Our
basic analysis will be comprised of two steps. Firstly, we will select
those areas that have the highest numbers of WZ population count - let’s
say above the 5th quantile (top 20% in other words), which in our case
> 658 people. Then we will use this information to extract the
Functional Sites that are located within the selected Workplace
Zones.
Open Attribute Table of the
WZ_population
layer
Click on the Select features using an expression
button
In the expression window type this simple query “WZ_pop” > 658 (it may not work if you do simple copy > paste) and click Select features
Now, you should have all the WZ with the population above 658
selected - 86 WZ in total
To select the Functional Sites that intersect with the selected
WZ go to Vector > Research Tools > Select by
Location
Select features in Functional Site that intersect with WZ_population
Check the box Selected features only
Click Run
Check your output against the map below:
Go to FunctionalSite layer and export the selected
features as a new shapefile and name it WZ_FunctionalSites
(Right click FunctionalSite > Export > Save Selected Faetures
As… )
Note: If you are getting an error saying: Feature has
invalid Geometry… This can be fixed by enabling the Processing
Toolbox (right-click the top anywhere and toggle on)
> Fix geometries (type in the search box ‘Fix
geometries’).
Put WZ_population as the Input layer.
Click the (…) next to [Create temporary layer] to save to your directory. Choose where to save the output and name it WZ_population2.
Continue the rest of the instructions with the newly saved (WZ_population2) shapefile.
Labels can be added to a map to show some information about an object/spatial entity. Any vector layer can have labels associated with it. These labels rely on the attribute data of a given layer for their content. In this practical, we will display labels for the WZ_FunctionalSites layer. Follow the steps below:
As we have labelled all the sites, the labels tend to overlap and as such, may not be very useful. Ideally’ we would show only those labels for the major employers such as hospitals, universities and the airport.
This can be executed by using the Rendering function within the Labels window. You need to create a simple SQL query that will select the above mentioned sites. This method gives you full control over the labels you want to display.
In the Label options, scroll down to the
Data defined > Show label button
Click on it and select Edit.
In the window that opens up, write a simple SQL query that will
select the required three features
First, familiarise yourself with SQL queries here: https://www.w3schools.com/sql/sql_wildcards.asp and then use the following query: “distname” LIKE ‘%Hospital’ OR “distname” LIKE ‘%Airport’ OR “distname” LIKE ‘%University%’
If you wish, change your font to Arial and font size to 12 and add buffer and drop shadow
One of the most useful features in QGIS is the ability to manually adjust label placement, as the default settings often don’t provide optimal positioning. The built-in Label Placement options are limited, making it difficult to achieve the desired label placement. The solution is as follows:
WZ_FunctionalSites
layer to the Liverpool
boundary, as the largest site, Port of Liverpool, currently extends
beyond the city limits. First, create a new Liverpool boundary layer to
clip any layer - in this case the
WZ_FunctionalSites
layer.Then do the clip:
WZ_FunctionalSites
as the Input
layer and Liverpool_boundary
as the
Overlay layerWZ_FSites
, click
OKWZ_FunctionalSites
layer >
Styles > Copy StyleWZ_FSites
> Styles >
Paste Style (this step saves you time as you can simply copy
> paste all styling work you have done so far)WZ_FunctionalSites
layer from the
Layers PanelNow that we have set up our layers, compared the day-time vs. night-time population in Liverpool, done basic spatial analysis and looked at population change, we can start creating some maps. It is simply possible to save your maps as image or PDF files using Project > Import/Export > Export Map to Image/PDF…. This is useful if you need a simple map without any key/legend. Instead, we will produce maps which include key cartographic elements, so they can be published. More specifically, in order to make maps publishable and easily interpretable there are several things you need to be aware of, such as the layout, level of generalisation, clarity of symbols, and perhaps above all, some understanding about what is the purpose of your map.
Liverpool Key Employers
as the title and click
OK, the Print Layout window will now open with a blank
pageYou should notice that the data layers that we have on display in the Print Layout are the same as that in our QGIS project (i.e. the two displays are linked). So if you need to adjust anything in Print Layout, switch windows back to the QGIS project. Ensure you have switched on only the following layers: Liverpool boundary, WZ_FSites and Buildings
Legend
Go to Add Item > North Arrow and draw the extent of it on the map.
You can select a symbol of your choice under Item Properties. Choose one of the SVG images of a north arrow that you prefer.
Once you have finished your map, go to Layout>Export
as image.
Specify the output type as TIFF and name the file in a sensible way - e.g., Major Employers in Liverpool.
For publishable maps, use a resolution of at least 300dpi
Your final map should look similar to the one below:
Does your map have the same extent as the one above? If not, then
go back to the main QGIS project and clip the WZ population
layer to this trimmed extent of Liverpool City Borough (your
Liverpool_boundary layer).
You have now completed the Practical 1 exercise. Well done!!!
You may also need to use Census 2021 data for any other research project (e.g. your dissertation) so the short instructions below demonstrate how to download Census 2021 data from the Nomis website.