1 Introduction

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.

1.1 Learning Aims and Objectives

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:

  1. Basic GIS/spatial analysis
  2. Numeric data classification schemes
  3. Develop an understanding of daytime and night-time population structure through workplace zone statistics, ONS population estimates and employment data
  4. Basic cartography: using population and built environment data to create publishable maps

2 Practical 1 - Part I

2.1 Getting data

  • Create a new folder for this practical (ideally on the university shared M drive: (e.g. M: Prac1) - this is your “working directory”
  • Download data Prac1_data from Canvas and unzip it to your working directory (on Windows machines right click the file > Extract All).

2.2 Displaying data in QGIS

  • Start QGIS by clicking on Start > QGIS Desktop (or any other QGIS version available on your machine; please note that this instruction is written for QGIS 3.40, so other versions may slightly differ)

2.2.1 Adding layers

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

  • Start by clicking the Add Vector Layer button AddLayer or Layer>Add Layer>Add Vector Layer…
  • Then click on the Browse button and navigate to your working directory. Open the LivPop_2021.shp file located in the Prac1_data folder
  • Click Open and then Add (if a window pops up, click on Cancel or just close it)
  • Change the name of the layer to 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 Info 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.

2.2.2 Changing the display colour

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 Style_tab. 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.

  • Also experiment with the more advanced Fill option by going to Fill > Simple fill > Fill color option and selecting Transparent fill. Then go to Stroke width and change the default value first to 1mm and click OK. Then adjust the value to 0.1mm, click OK. Finally go to Stroke style and select No line.
  • See what happens; when such styling could be useful?

2.2.3 Grouping layers

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.

  • Using the same steps as previously, add more shapefiles to your QGIS project.
  • First, add files from the OS_data/OS_Liverpool folder: FunctionalSite.shp, Road.shp and Railway Track.shp (You may need to unzip the files first)
  • Then, highlight the newly added files, right click on them and choose Group Selected
  • The default name is group 1 so we need to change it to something more meaningful such as OS data.
  • Right click on it > Rename

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.

  • Select Project/Save and save the GIS project to your working directory.

2.2.4 Classifying data

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:

  • Right click on the Population layer
  • Go to Properties > Symbology
  • From the drop down menu on the top select Graduated
  • Use Total Pop as your Value to classify the population dataset
  • Choose 5 Classes and select Equal Count (Quantile) as your Mode
  • Click on Classify and then OK

At this stage, the Symbology window should be filled as on the picture below:
Classify

Now, we are going to change the default colour and adjust LSOA boundaries, so the map looks more professional.

  • Go to the Properties>Symbology window and choose Blues for your Colour ramp
  • Then navigate to Symbol > Configure Symbol.
  • Click on Simple fill and select 0.1 as your Stroke width
  • Click OK twice

Your map should now look something like the one below:
pop1

  • 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

2.2.5 Basic statistics and field calculator

  • 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.

3 Practical 1 - Part II

3.1 Workplace Zones and joining tabular data

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:

  • Go to Workplace Zone/shapefiles folder, select WPZONE.shp and drag and drop it to the Layers Panel
  • Add the WP102EW.csv table from the Workplace Zone/tables folder
  • Open Attribute Table of the WPZONE layer and explore it
  • What information is included in the dataset, and how should it be understood or interpreted?

There 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)
    JoinTables

  • 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:

  • Right click the layer then Export > Save features as choose ESRI Shapefile as your format,
  • Click on the Browse button (three dots) and navigate to your M: drive; name the permanent layer WZ_population
  • Click Save then OK
  • Once you create the permanent layer, it will be added automatically to the Layers Panel
  • You can delete now the WPZONE layer and the WP102EW table from your Layers Panel

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:

3.1.1 Renaming variables, field calculator

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:

  • Go to Attribute table of the WZ population layer
  • Select Toggle editing modeToggleEdit
  • Click on Open field calculator button
  • In the dialog box that opens check the Create a new field box, type WZ_pop in the Output field name box and choose Integer (64 bit) as your output field type
  • In the expression window specify the name of the column that need to be renamed, in our case it is the "WP102EW_WP" or something similar (this may vary depending on the version of your QGIS)
  • Go to Fields and Values and double click on the WP102EW_WP
  • Click OK and the new column should be added automatically. If this is not the case please ask for help.
  • Save your edits by clicking the Toggle editing mode button
  • Repeat the above steps for the WP102EW_2 column too - name it Density (use Decimal number (real), set Precision to 2, if you can change it)
  • Finally, delete the redundant columns by clicking on Delete field Delete_column button in the Attribute table
  • Click again Toggle editing mode and save the changes

3.2 Mapping Workplace Zones population in Liverpool

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:
    WZ_pop1

  • 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?

3.3 Basic GIS analysis

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 Select_query

  • 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: Select_Location

  • 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’).
Fix geom

  • 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.

3.3.1 Labelling

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:

  • Go to the layer and right click, then Properties > Labels and select from the drop-down menu Single labels
  • Use ‘distname’ for the Label with field
  • Click OK

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:

  • Make sure that your Labels toolbar is active (if not, then right-click the top anywhere and toggle on)
  • Then click on this button Move label
  • Drag and drop any label wherever you wish

3.3.2 Clipping layers to the extent of Liverpool boundary

  • Clip the 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_FunctionalSiteslayer.
  • Go to Vector > Geoprocessing Tools > Dissolve
  • Choose Population as your Input layer > Click Run
  • Save the automatically created layer as permament and name it Liverpool_boundary

Then do the clip:

  • Go to Vector > Geoprocessing Tools > Clip…
  • Use the WZ_FunctionalSites as the Input layer and Liverpool_boundary as the Overlay layer
  • Click on Run and save the output to your working directory, name it WZ_FSites, click OK
  • Right click the WZ_FunctionalSites layer > Styles > Copy Style
  • Right click the WZ_FSites > Styles > Paste Style (this step saves you time as you can simply copy > paste all styling work you have done so far)
  • Remove the WZ_FunctionalSites layer from the Layers Panel
  • Save the project
  • If you have done it correctly, your map should look similar to the one below:
    WZ_Functional Sites

4 Practical 1 - Part III

5 Download Census 2021 data from Nomis (Additional information - optional)

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.