Data preparation

Getting started

Some of you may already have played around with some GIS software such as ArcGIS or at very least have been introduced to ArcGIS Online in Geography in the Field 1, but today we will be using the open-source GIS software suite QGIS.

A copy of QGIS comes pre-installed on all cluster room computers as well as on Desktop@UCL Anywhere. Desktop@UCL Anywhere is a service that allows remote access to UCL resources for staff and students. All you need is a valid UCL user ID and password, an internet connection and supported web browser. Today we will be using this Desktop@UCL Anywhere service to ensure that everyone uses the same version.

Let’s get started by opening an internet browser such as Google Chrome or Microsoft Edge. Now navigate to: https://ucldesktop.cloud.com.

Figure 1: Desktop@UCL Anywhere login interface. [Enlarge image]

You can log in with your normal UCL username and UCL password. After this, you click on the Desktop@UCL Anywhere icon to start the service:

Figure 2: Starting Desktop@UCL Anywhere. [Enlarge image]

It may take a few minutes to load, but after this you should see your normal UCL Windows desktop:

Downloading crime data

For our crime data, we will use data directly from the Police Data Portal, which you can find at data.police.uk. This Data Portal allows you to access and generate tabular data for crime recorded in the U.K. across different the different police forces. In total, there are 45 territorial police forces (TPF) and 3 special police forces (SPF) of the United Kingdom. Each TPF covers a specific area in the UK (e.g. the “West Midlands Police Force”), whilst the SPFs are cross-jurisdiction and cover specific types of crime, such as the British Transport Police. Therefore, when we want to download data for a specific area, we need to know which Police Force covers the area of interest for our investigation.

When you look to download crime data for London, for example, there are two territorial police forces working within the city and its greater metropolitan area:

  • The Metropolitan Police Force, which covers nearly the entire London area, including Greater London
  • The City of London Police, which covers the City of London. The Met has no jurisdiction in the City of London.

Today we will leave the City of London for what it is because we will look at crime hotspots in the London boroughs of Camden and Islington, both of which are not part of the City of London. To download our data, open Google Chrome (within your Desktop@UCL environment) and navigate to data.police.uk.

You are free to use a different browser, however, some the steps below on how to download the files may be slightly different.

Figure 4: The landing page of data.police.uk. [Enlarge image]

Click on Downloads and subsequently select November 2021 to November 2021 as data range and tick the box for the Metropolitan Police Services. With this selection we can now download all crime data recorded by the Metropolitan Police Services for the month of November 2021.

Figure 5: Select the data that we want to download. [Enlarge image]

Make sure that the box in front of Include crime data is ticked - it should be ticked by default - and proceed to click on Generate file. Once your file is generated you can click on Download now.

Figure 6: Donwload the data. [Enlarge image]

Save the file as crime_met_november2021 in your Downloads folder.

Figure 7: Save the data. [Enlarge image]

Your download should be finished within seconds. After downloading the data, go to your Downloads folder and right click on the crime_met_november2021.zip folder and click on Extract All. The data, which is in a compressed format (zip), will now be extracted so that we can use it within QGIS.

Figure 8: Unzip the data. [Enlarge image]

Now we have downloaded the crime data, we need to download some background and reference data. Two data sets are available on Moodle: the boundaries of the boroughs in London as well as the London road network. Within your UCL Desktop environment, navigate to the Geography in the Field II Moodle page and scroll down to Week 08: Mapping London.

Figure 9: Geography in the Field II Moodle page. [Enlarge image]

Under the Further resources heading you will see two files: Roads for mapping exercise and Boroughs for mapping exercise. Right click on on the first file and click on Save link as …. Give the file the name roads and save to your download folder.

Figure 10: Save link as. [Enlarge image]

Figure 11: Save file to your downloads folder. [Enlarge image]

Right click on on the second file and click on Save link as …. Give the file the name boroughs and save to your download folder.

After downloading both files, go to your Downloads folder and make sure both are extracted. Your Downloads folder should look something like this:

Figure 12: Your download folder should now contain three unzipped folders containing our crime data, our borough data and our road data. [Enlarge image]

The final step we need to take is to copy our downloaded data to a new folder. In your Documents folder, create a new folder GEOG0014_W08. We will use this folder as our working directory. Now move the three folders containg the crime data, borough data and road data that you unzipped from your Downloads folder to this new GEOG0014_W08 folder. Your working directory should look like this:

Figure 13: Your working directory is now all set up. [Enlarge image]

We are now ready to move to mapping in QGIS.

The roads and boroughs file that we downloaded is something called a shapefile. A shapefile is a file that GIS software uses to store spatial data. In the case of a shapefile this is in actual fact a misnomer because a shapefile consists of a collection of files. Without going into detail: each of these files does something slightly different and the the software we will be using requires needs all of them in order to understand the data.