Geospatial Pondering: Processing, Manipulation & Visualisation of Data
By: William Ray
Tags: Cartography, Qgis, GIS, Cycling, Dataviz

Maps and cartography have always been something I have been fascinated by. Whether studying the road map in the back of the car while travelling down France for a family holiday or dreaming up cycling trips on Google Maps maps are never far from my mind!

Studying Geography meant I was lucky enough to get training and experience using GIS software and move on from studying maps to actually exploring and analysing geographic data and then creating maps of my own to portray my arguments. My early attempts weren’t great, but two years of working as a GIS Analyst straight after university helped hone my geospatial analysis and cartographical skills.

Four years on my cartographical skills are a little rusty but is a skill I want to build up properly again. I needed to find a project I had an interest in and datasets worthwhile working on and luckily something landed in my lap a couple of months ago:

Oxford County Councillor & Cycling Champion Dr Suzanne Bartington tweet about the Propensity to Cycle tool got my interest. Visualising the data it was striking how levels of walking and cycling immediately dropped outside the city of Oxford. Most people who know me also know that I’m hugely passionate about encouraging active travel in and around urban areas so it was really important to me to understand why the cycling and walking levels dropped outside of the city. I thought I had a pretty good idea why but using this data I wanted to prove this statistically (there will be more on this in my next post).

I wanted to visualise some of the data and try and try and spot some patterns visually before analysing the data in more detail. My focus in this post will be to present the tools available to visualise the data and discuss some of the good and bad points of the different ways you can present the data.

Data Download and Preparation

Firstly, the data needed downloading from the Propensity to Cycle website. For my purposes, I wanted the commuting zonal data for Oxfordshire (you can also download the national dataset too). The data is based upon 2011 England & Wales census data and there is a choice to download the data at two super output area levels of which I chose LSOA area level (the finest scale).

What are Super Output Areas?

Don’t worry this was a brand new term for me as well! Super Output Areas were generated for census purposes beginning in the 2001 England & Wales census. There are two categories of area: lower layer super output areas (LSOA) and middle layer super output areas (MSOA). Generally, LSOAs have a population of between 1000 and 3000 and MSOAs have a population of 5000–15000 people. Their purpose is to provide stable results between censuses allowing census geographers to be able to compare and contrast geographical results between censuses.

Visualising the Propensity to Cycle LSOA zones & attributes

To visualise the data I use QGIS a FOSS GIS software that is perfect for expert and non-expert users alike. The downloaded geojson file required reprojecting to British National Grid and at the same time, I converted it to shapefile format that is more universal to work with. In the attribute table (geographically located table data) I could see the column for ‘bicycle’ denoting the number of cyclists commuters for each LSOA zone. This is the column I will use for visualisation.

Visualising the Data

Using this column we can generate a map of the number of cyclists in each LSOA. This could be as simple as a label for each polygon but this wouldn’t be very interesting or useful to look at. A much better method is to use a graduated colour map like below:

raw data — equal count (quantile) 5 class-map

In the above map, the ‘Bicycle’ column values have been allocated into 5 classes. I chose to use a pale pink to purple gradient as there is a good distinction between the different classes and the colours used are intuitive with the bolder colours insinuating higher cycling participation rates. In this instance, the Equal count quantile mode (QGIS default) has been used. It does show that the highest numbers of cyclists can be found in Oxford and there are much lower numbers in the rest of the county. But there is a lack of detail, the whole city is one class (95–318 cyclists per LSOA). Perhaps increasing the number of classes to 10 may produce a more detailed map? Let’s see:

raw data — equal count (quantile) 10-class map

OK, yes there is a bit more detail now. Oxford city isn’t one homogenous patch of purple, and there are less hard lines on the map now which is good. However, the bin size of the classes doesn’t look very logical. Each class has an even number of records but an uneven interval range. Class 1 includes LSOAs with 1–10 cyclists while Class 10 includes LSOAs with 144.2–318 cyclists. The dataset is clearly not evenly distributed, so let’s have a look at a histogram of the values:

Histogram of the dataset overlaid with 10 classes split using equal count (quantile)

As suspected the dataset isn’t evenly distributed and the histogram is heavily skewed towards values on the lower end of the scale. Instead of classes with equal numbers of records, we could try classes with equal intervals instead:

raw data — equal interval 10-class map

Wow! that has made a huge difference and paints a very different picture. The higher more extreme values are far less common and there is a lot more variation in classes within the city of Oxford itself. However, the detail gained in the higher end of the scale has meant some detail has been lost in the more rural areas of the county where cycling rates are lower. The majority of records are found within class 1 and 2. This is reflected in the histogram below too.

Histogram of the dataset overlaid with 10 classes split using equal interval

Two other methods may be useful for visualising this data. There is Natural Breaks (Jenks) that tries to find natural groupings of data, basing its classes off this, and Pretty Breaks that tries to create class boundaries with round numbers. Let’s try these out:

raw data — natural breaks (Jenks) 10-class map

There’s not too much change using the natural breaks mode, although there is a little bit more detail in areas with lower cycling level classes.

raw data — pretty breaks 7-class map

Interestingly, when 10 classes are specified the pretty breaks mode only calculates 7 classes as the optimum amount. It is very similar to the equal interval mode but has the added benefit of ‘round’ class boundaries making it the most user-friendly mode.

However, even though there is some normalisation in the LSOA data, each zone still has an absolute value and each LSOA has a slight variation in population making the absolute values less useful. Luckily, the overall figure is also included in the attributes so the percentage of cyclists can be calculated which makes LSOAs more directly comparable. Let’s see how this looks:

percentage (0–100%) map

OK, this needs some work. Using the full range of 0 to 100% we seem to have lost a lot of the precision we had previously. A lot of the classes we have created are unused in the map, and this can be seen clearly in the histogram below:

Yes, as predicted the maximum percentage of cycling participation is only about 65% so, in the previous map, the classes >70% were redundant. The histogram also shows the vast majority of the data points are found at 30% and below. Let’s try using the pretty breaks mode and see what it thinks is a good class system:

percentage (pretty breaks) map

Great, this looks really good now. The pretty breaks mode has split the data into 5% intervals creating a 13 class-map with good precision at both ends of the cycling participation scale. This looks great for the purpose of displaying cycling participation percentages in isolation. Interestingly, there appears to be a divide in Oxford itself with higher rates of cycling in the centre and immediately to the north of the city centre, but there are lower rates of cycling in the south and east of the city.

However, you may want to compare the percentage of cycling participation to the percentage driving to work. Using this custom scale wouldn’t be suitable in that case. The percentages driving are in general far higher and using the same scale would result in a very homogenous and impractical map. Therefore, using the 0–100% scale would be most suitable if comparing to other transport modes.

Lastly, you can display your data in lots of very imaginative ways. These are especially useful when being used to make a specific point.

Cartogram of Oxfordshire LSOA cycling percentages

Cartograms are a popular way to display census data; using a specific variable the geometry of a map is deliberately distorted sometimes in extreme ways. In this instance, it is obvious that Oxford itself has far higher cycling levels than the rest of the county that has been heavily compressed. However, for someone not familiar with the geography of Oxfordshire, this cartogram is not useful at all as it distorts the county geographies too far.

Map emphasising areas of Oxfordshire with high and low cycling rates

You could also emphasise extremes in your dataset to help communicate your point, like in the above example that shows how cycling levels are very low in the majority of the county of Oxfordshire and there are only small pockets where cycling participation is above half.

However, again the map doesn’t tell the whole story. The larger LSOAs are rural areas with much lower population densities and so naturally dominate the map. Arguably, this is a critcism of all the previous maps (apart from the cartogram) which show the area rather than the number of cyclists. To truly show a representative picture, each LSOA should be depicted as equally sized areas in any visualisation.

This is what is fascinating about cartography and data visualisation in general. Throughout this piece, only cycling rates are depicted but I am still struck by how individual each map looks. An important lesson I’ve learnt is to never accept the default settings; always try out the other settings which may be more suited to your data. The beauty of cartography is how the analyst balances their technical know-how and geographic knowledge with the priorities of data visualisation, making sure the map is useful, communicative and attractive to look at all at the same time.

I hope you have enjoyed the read whether as an experienced cartographer or somebody new to the subject. My next post will focus more upon the Why? cycling levels vary across Oxford and Oxfordshire. Hopefully, the next post won’t take so long to write next time!

Will

Further Note: since writing this, I’ve purchased a copy of How to lie with Maps by Mark Monmonier. If you want to find out more about data visualization and cartography then this is a great read!

References:

Lovelace, R., Goodman, A., Aldred, R., Berkoff, N., Abbas, A., Woodcock, J., 2017.The Propensity to Cycle Tool: An open source online system for sustainable transport planning. Journal of Transport and Land Use. 10:1, 505–528, DOI: 10.5198/jtlu.2016.862.

www.ons.gov.uk/methodology/geography/ukgeographies/censusgeography

www.qgistutorials.com/en/docs/basic_vector_styling.html

www.dataquest.io/blog/what-to-consider-when-choosing-colors-for-data-visualization/

//ukdataservice.ac.uk/media/622463/qgiscartogram.pdf