LogoLogo
OS Docs HomeOS NGDOS APIsOS Download ProductsMore than MapsContact Us
  • More than Maps
  • Geographic Data Visualisation
    • Guide to cartography
      • Introduction to cartography
      • Types of maps
      • Symbology
      • Colour
      • Text on maps
      • Generalisation
      • Coordinate reference systems
      • Projections
      • Scale
      • Map legends
      • Map layout
      • Relief representation
      • North arrows
    • Guide to data visualisation
      • Introduction to data visualisation
      • GeoDataViz design principles
      • Types of visualisation
      • Thematic mapping techniques
      • Data visualisation critique
      • Accessible data visualisation
      • Ethical data visualisation
      • Software
      • Data
    • GeoDataViz assets
      • GeoDataViz basemaps
      • Stylesheets
      • GeoDataViz virtual gallery
      • Equal area cartograms
      • How did I make that?
        • Apollo 11 Landing
        • North York Moors National Park, 70 years
        • Snowdonia National Park, 70 years
        • Great Britain's National Parks
        • Great Britain's Islands
        • Great Britain's AONB's and National Scenic Areas
        • Famous shipwrecks of Pembrokeshire
        • Trig pillars today
        • Britain's most complex motorway junctions
      • #30DayMapChallenge
  • Data in Action
    • Examples
  • Demonstrators
    • 🆕Product Viewer
    • Addressing & location demonstrators
      • Address Portfolio overview
      • Which address product should you use?
      • AddressBase
      • AddressBase Core
      • AddressBase Plus
      • AddressBase Premium
      • Address Classifications
      • Addressing Lifecycle
      • OS Emergency Services Gazetteer
      • What are Vertical Streets?
      • Why are there differences in boundaries?
    • Contextual demonstrators
    • Customer best practice
      • Channel Shift
      • Data Management and OS Data Hub
      • End User Licence vs Contractor Licence
      • 🆕 IDs vs Spatial Relationships
      • Why we should capture good quality addresses at source
      • Why we Snap and Trace
    • Network Demonstrators
      • OS Detailed Path Network
      • OS Multi Modal Routing Network
        • OS Multi Modal Routing Network
      • Water Networks overview
      • OS MasterMap Highways Network and OS NGD Speeds
      • OS MasterMap® Highways Network and OS Open Roads™
    • OS MasterMap Generation APIs
      • Using the OS Features API
      • Using the OS Features API Archive
      • Using the OS Downloads API
      • Using OS APIs in ESRI Software
    • 🆕OS NGD (National Geographic Database)
      • OS NGD Address
      • OS NGD Boundaries
      • 🆕OS NGD Buildings
        • 🆕Building and Building Access Feature Types
        • Building Part and Building Line Feature Types
      • 🆕OS NGD Geographical Names
      • OS NGD Land
      • OS NGD Land Cover enhancements
      • 🆕OS NGD Land Use
      • OS NGD Land Use enhancements
      • 🆕OS NGD Structures
        • 🆕OS NGD Structures
        • Field Boundaries
      • 🆕OS NGD Transport Features
      • 🆕OS NGD Transport Network
      • OS NGD Transport RAMI
      • OS NGD Water Features
      • OS NGD Water Network
      • OS NGD API - Features
      • Ordering OS NGD data
      • Change only updates
      • OS NGD Versioning
      • Creating a topographic map from OS NGD Data
      • Analytical styling for OS NGD data
    • OS MasterMap® demonstrators
    • 🆕Product & API Comparisons
      • 🆕Comparison of Water Network Products
  • Tutorials
    • GeoDataViz
      • Thematic Mapping Techniques
      • Downloading and using data from the OS Data Hub
      • How to download and use OS stylesheets
      • How to use the OS Maps API
      • Creating a bespoke style in Maputnik
    • GIS
      • Analysing pavement widths
      • Basic routing with OS Open Data and QGIS
      • Walktime analysis using OS Multi-modal Routing Network and QGIS
      • Creating 3D Symbols for GIS Applications
      • Constructing a Single Line Address using a Geographic Address
      • Creating a Digital Terrain Model (DTM)
      • Visualising a road gradient using a Digital Terrain Model
      • Visualising a road gradient using OSMM Highways
    • 🆕APIs
      • 🆕Using OS APIs with EPC API
      • 🆕OS APIs and ArcGIS
  • Deep Dive
    • Introduction to address matching
    • Guide to routing for the Public Sector
      • Part 1: Guide to routing
      • Part 2: Routing software and data options
      • Part 3: Building a routable network
    • Unlocking the Power of Geospatial Data
    • Using Blender for Geospatial Projects
    • A Guide to Coordinate Systems in Great Britain
      • Myths about coordinate systems
      • The shape of the Earth
      • What is position?
        • Types of coordinates
        • We need a datum
        • Position summary
      • Modern GNSS coordinate systems
        • Realising WGS84 with a TRF
        • The WGS84 broadcast TRF
        • The International Terrestrial Reference Frame (ITRF)
        • The International GNSS Service (IGS)
        • European Terrestrial Reference System 1989 (ETRS89)
      • Ordnance Survey coordinate systems
        • ETRS89 realised through OS Net
        • National Grid and the OSGB36 TRF
        • Ordnance Datum Newlyn
        • The future of British mapping coordinate systems
        • The future of British mapping coordinate systems
      • From one coordinate system to another: geodetic transformations
        • What is a geodetic transformation?
        • Helmert datum transformations
        • National Grid Transformation OSTN15 (ETRS89–OSGB36)
        • National Geoid Model OSGM15 (ETRS89-Orthometric height)
        • ETRS89 to and from ITRS
        • Approximate WGS84 to OSGB36/ODN transformation
        • Transformation between OS Net v2001 and v2009 realisations
      • Transverse Mercator map projections
        • The National Grid reference convention
      • Datum, ellipsoid and projection information
      • Converting between 3D Cartesian and ellipsoidal latitude, longitude and height coordinates
      • Converting between grid eastings and northings and ellipsoidal latitude and longitude
      • Helmert transformation worked example
      • Further information
  • Code
    • Ordnance Survey APIs
    • Mapping
    • Routing with pgRouting
      • Getting started with OS MasterMap Highways and pgRouting
      • Getting started with OS MasterMap Highways Network - Paths and pgRouting
      • Getting started with OS NGD Transport Theme and pgRouting
      • Getting started with OS NGD Transport Path features and pgRouting
  • RESOURCES
    • 🆕Data Visualisation External Resources
Powered by GitBook

Website

  • Ordnance Survey

Data

  • OS Data Hub
On this page
  • QGIS
  • Mapbox Studio

Was this helpful?

  1. Tutorials
  2. GeoDataViz

Thematic Mapping Techniques

PreviousGeoDataVizNextDownloading and using data from the OS Data Hub

Last updated 1 year ago

Was this helpful?

In this workshop we are going to explore various thematic mapping techniques. We will be using QGIS and Mapbox Studio to do this. By the end of it we will have created 5 different maps, all using the same data source.

The data that we’re using is about the greenspaces in Greater London. We have processed and created a centre point for each greenspace. We are also using some data from and .

Let’s get started…

QGIS

All the data for this workshop can be downloaded . Make sure it is downloaded onto your machine:

  1. Open QGIS

  2. First, we’re going to add in some contextual layers.

Add these 3 shapefiles (the files ending in .shp) from the ‘Data’ folder:

  • ‘Thames.shp’

  • ‘London-Boroughs.shp’

  • ‘London-outline.shp’

You can do this by dragging & dropping them into your QGIS window or by going to Layer in the top ribbon of QGIS > Add Layer > Add Vector Layer and browsing to the files on your machine.

  1. Re-order them in the ‘Layers Panel’ like this:

  1. Now we’re going to remove the fill from the Borough polygons.

Open the ‘Layer Properties’ panel by double-clicking on the layer ‘London-Boroughs’.

Go to the Symbology tab on the left, yhen click ‘Simple fill’ and change the ‘Fill style’ to ‘No Brush’, like this:

Click ‘OK

  1. Now style the Thames polygon with a light blue fill and remove the outline:

  1. Next, style the ‘London-outline’ to make it black with a width of 0.8mm.

You should have your contextual map ready now and it should look something like this:

  1. OK, now we’re going to add in our data about the greenspaces in London.

From the ‘Data’ folder, add ‘greenspace-within-london.shp’ to your map and make sure it’s at the top of the ‘Layers Panel’.

The points will be given a default style and will look something like this:

It isn’t very easy to make sense of this data so we’re going to style it to help improve the depiction.

  1. Double-click on the layer to open up the ‘Layer Properties’ panel.

Then click on the ‘Color’ to open the ‘Select color’ panel.

Within this panel, change the colour value (the ‘HTML notation’) to #7dc579 and reduce the ‘Opacity’ to 50%:

Click ‘OK’ and then adjust the settings in the ‘Layer Properties’ panel to look like this:

With a couple of simple colour techniques we have created a nice dot density map which shows ALL the data and gives us a good picture of the density and distribution of greenspaces across Greater London.

Your map should look something like this:

Next, we’re going to explore some options for aggregating the data, and we’ll start with a proportional symbol map.

Before we do this, turn off the ‘greenspace-within-london’ layer by unchecking the box next to it in the ‘Layers Panel’.

  1. For this map we need to do some geospatial processing. We’re going to count (or bin) the greenspace points into the London Borough boundaries.

From the top menu click ‘Processing’ then ‘Toolbox’:

This should open up the ‘Processing Toolbox’ along the right-hand side of your QGIS window.

  1. In the ‘Processing Toolbox’ search for count points.

Under ‘Vector analysis’ you should see a tool called ‘Count points in polygon’ - double-click it to open the settings panel.

  1. Change the settings so they look like this (you can choose to save to file if you want) and then click ‘Run’:

The processing should only take a few seconds, and then a new layer called ‘Count’ will appear in your ‘Layers Panel’:

If for some reason this doesn’t work, you can use ‘Boroughs-with-counts.shp’ from the ‘Backup Data’ folder.

  1. OK, now we need to style this layer to create our proportional symbols (circles in this instance).

Double-click the layer to open up the ‘Layer Properties’ panel and under the ‘Style’ tab, select ‘Graduated’.

Next, choose ‘NUMPOINTS’ as the column and click on the colour swatch next to ‘Symbol’

  1. In the ‘Symbol selector’ panel change the ‘Symbol layer type’ from ‘Simple fill’ to ‘Centroid fill’:

Now click on ‘Simple marker’ to expand the style options.

Next, click on the ‘Data defined override’ button next to ‘Size’ (see image below) and click ‘Edit…’:

  1. We’re now going to write a short expression to size the circles based on their value - we need to divide the values in order for the sizes to be correct for our scale of map.

In the ‘Expression string builder’ add in the following expression:

"NUMPOINTS" / 17 ← you can copy & paste this if you want to

The number 17 here is arbitrary really and may need to be changed dependent on the scale of your map and size of your monitor.

Click ‘OK’ to return to the ‘Layer Properties’ panel.

  1. Now, adjust the colour ramp to a ramp of your choosing (a single colour, light to dark colour ramp works nicely).

Then click ‘Classify’

Your proportional symbol map should look like this:

Next we’re going to look at creating a choropleth map and for this we are going to use the same data but change the styling.

First we need to run an extra bit of analysis on the data. You will often hear cartographers discussing the problems of mapping totals using choropleth maps (read more here).

Without normalising our data to a consistent denominator the map is not very useful and we can't make any sensible interpretations of the information.

We are going to normalise our greenspace data against the size of each Borough. We will be mapping the amount of greenspaces per km2 in each Borough rather than the total number of greenspaces per Borough. This takes into account the fact that they’re all different shapes and sizes and makes comparison fairer across the whole map.

  1. OK, so we need to add a new attribute to our data.

In the ‘Layers Panel’ right-click on the ‘Count’ layer and then click ‘Open Attribute Table’:

  1. Click on the little yellow pencil button to start editing then click on the abacus button to ‘open field calculator’:

  1. Now we’re going to create a new field.

Type in perkm2 as the ‘Output field name’ and then add the in this expression:

"NUMPOINTS" / ( $area / 1000000 ) 🡨 you can copy & paste this if you want to

We’re working in British National Grid (ESPG:27700) so our map units are meters. This calculation converts our values to kilometre squared.

Click ‘OK’

  1. Click on the little yellow pencil button again to stop editing and then click ‘Save’.

We now have a new attribute field called perkm2 which contains a number for every Borough which represents the number of greenspaces per km2.

Close the attribute table and now we’re going to style our choropleth...

  1. In the ‘Layers Panel’, double-click on the ‘Count’ layer to open up the ‘Layers Properties’ panel.

Click on the little symbol next next to ‘Symbol in order to open up the ‘Symbol selector’:

  1. In this panel, change the ‘Symbol layer type’ from ‘Centroid fill’ to ‘Simple fill’:

Click ‘OK’

  1. In the ‘Layer Properties’ panel. Change the ‘Column’ to perkm2 and click ‘Classify’

Feel free to experiment with the different classification algorithms:

Click ‘OK’ and you have a choropleth map which should look something like this:

Great! We’ve now made 3 different maps, and visualised the same data source in 3 different ways!

So far we’ve been using the London Borough boundaries and these geometries are irregular sizes and shapes.

  1. We are going to use a QGIS Plugin called ‘MMQGIS’ to generate our hexagon grid. If it doesn’t appear in your top menu then you will need to install it by clicking ‘Plugins’ then ‘Manage and Install Plugins…’

Search for ‘MMQGIS’ and click ‘Install plugin’

  1. Once the plugin has been installed, in the top menu click ‘MMQGIS’ then ‘Create Grid Layer’ to open up the ‘Grid’ panel:

In the ‘Grid’ panel, choose Hexagons as the ‘Shape Type’ and change the ‘Y Spacing’ to 2000 (this will give us hexagons that are 2km in height). Choose a location to save your new shapefile (…) and click ‘Apply’:

You should now have a new layer in your ‘Layers Panel’ and a hexagon grid covering the extent of your map window.

If for some reason this doesn’t work, you can use ‘hexagon-grid.shp’ from the ‘Backup Data’ folder.

  1. Now that we have a grid, we need to count (or bin) our greenspace points into each grid cell. To do this, we’re going to go back into the ‘Processing Toolbox’ and use the ‘count points in polygon’ tool again:

In the settings panel, select your hexagon grid layer as the ‘Polygons’, ‘greenspace-within-london’ as the ‘Points’ and make sure the ‘Count field name’ is NUMPOINTS.

Click ‘Run’. This will add a new layer into your ‘Layers Panel’

If for some reason this doesn’t work, you can use the ‘hex-with-counts.shp’ from the ‘BackupData’ folder.

  1. Before styling our grid, we’re going to add a filter on it so we only see the cells that contain data. Double-click the newly created layer to open up the ‘Layer Properties’ panel then switch to the ‘Source’ tab and click ‘Query Builder’:

  1. Add the expression:

"NUMPOINTS" != 0 🡨 You can copy and paste this if you want

Click ‘OK’

  1. Now we’re going to style our hexagon grid. Switch back to the ‘Style’ tab.

Change the style settings so they look like this:

To change the colours of each category, right click on the colour swatch and go to ‘Change Colour’. Use the colour hex codes in the ‘HTML notation’ box as follows:

#FCE1A4, #FABF7B, #F08F6E, #E05C5C, #D12959, #AB1866, #6E005F

Please feel free to choose a different colour palette.

When you’re happy, click ‘OK’.

Your map should look something like this:

So far, we have explored 4 different mapping techniques within a GIS. If we were creating a finished map, then we would probably add some other features. These may include a title, description, legend, labels/annotations and possibly even a scale bar or locator map.

  1. Have a go at creating a full layout! Go to ‘Project’ and ‘New Print Layout’. Give your layout a name and click ‘OK’.

  1. Add a map, legend and text to your layout

You may need to edit each item using the ‘Item Properties’ panel on the right of your screen. This may mean changing the ‘scale’ of your map Item so it fits on the page (Try 250000). You can also use the ‘Interactively Edit Map Extent tool’ so you can move your map around and zoom in/out.

For your legend, you’ll likely want to turn off ‘Auto Update’ and use the Minus button to remove unwanted legend items.

Your layout might end up looking something like this:

Now we’re going to look at Mapbox Studio and create a web map that will be mobile friendly by default. We’re going to take our hexbin map a step further and explore the z-axis - adding a 3rd dimension to our data.

Mapbox Studio

If you have an account, login. If you don’t have an account, you can create one for free – it doesn't take long.

  1. Once you’re in Studio, click on ‘Tilesets’ in the righthand menu, under ‘Resources’.

  1. Click on ‘New Tileset’

  1. Click ‘Select a file’, then browse to the ‘Data’ folder and select ‘hex-with-counts.geojson’:

Click ‘Confirm’.

It may take a few minutes to upload the new data (but it will be worth it, honest).

When our new tileset has successfully uploaded it will appear at the top of our Tileset list.

  1. Now we’re going to create a new map. Click on the ‘Styles’ tab on the right-hand menu and then click ‘New style’

  2. Select ‘Monochrome’ and then ‘Dark’. The click ‘Customize Monochrome’

This will load up the map interface. Pan around and zoom in to London.

Now we’re going to load our hexagon grid into this map.

  1. Click on the ‘+’ (Add New Layer) button in the top-left.

  1. Click on ‘Custom Layer’. A new panel then should open up just to the right.

  1. Under ‘Source’, click on ‘None Selected’ and then select your ‘hex-with-counts’ data you just added.

You should now have something that looks like this:

  1. In the editing panel, change the ‘Type’ to ‘Fill extrusion’

  1. Our new layer should now appear in the layer panel on the left. Click on the 6 little dots next to the layer.

The map view will now change to be tilted. The data is given a default black fill - so now we’re going to style it.

  1. Click on ‘Colour’ and then ‘Style across data range’ and then ‘Num #’

  1. Check there is a number 1 in the ‘Num’ box, change the ‘HEX’ to #ffffff and then click ‘Done’

  1. Next, select ‘edit’ on the ‘num 90’ box. Repeat stage 4, checking there is a number 90 in the ‘Num’ box and this time change the ‘HEX’ to #009991 and click ‘Done’. Your setting and map should look like this:

15. Next click on ‘Height’ then select ‘Style across data range’ and then ‘num #’.

  1. Like you did before, ensure there is a number 1 in the ‘num’ field and change the ‘Fill height’ to 100. The click Done.

  1. Click ‘Edit’ for ‘num 90’ and change the ‘Fill height’ to 10000. Click ‘Done’

Your settings and map should now look like this:

  1. Click on ‘Opacity’ and change the ‘Fill Opacity’ to 0.65. This allows you to see some of the underlying data. Feel free to have a play with the opacity.

You can use your right mouse button to adjust the pitch and bearing of your map. It should look something like this:

Feel free to play around with the other layers in the map (roads, water, labels etc.) - style it to suite your own needs or preferences.

It is also good practice to move your new thematic layer below the map labels. You can do this by dragging and dropping it in the left-hand panel.

  1. When you’re happy with your map, you’re ready to publish it!

Click on the ‘Publish…’ button in the top righthand corner of your screen.

On the next screen, click ‘Publish’ again. You should get a pop up saying your Style has been successful published. Click ‘OK’.

  1. Your map is now hosted on your Mapbox account and you have a number of options for how you can use it; from simply sharing it, viewing it in a GIS or developing it further using one of Mapbox’s libraries.

For our final step we’re going to check that our map looks good on a mobile device. Mapbox have an app that makes this easy for us. If you have an Android or iOS device then install the Mapbox Studio Preview app from the relevant store.

Using this app you can sign-in with your account details and view your styles on your device.

The ‘Multiply’ blend mode means that overlapping features will appear darker on the map, giving us a better idea of density. (You can read more about blend modes .)

By default, this adds in 5 classes using the ‘Equal Interval’ algorithm (you can read more about the different options ).

Next we’re going to look at using a regular grid. We’re going to use hexagons to create a hexbin map. for more information about the benefits of using Hexagons over other tessellating shapes such as squares.

These colours are from our .

In a web browser, preferably Google Chrome, go to .

here
here
Read this
GeoDataViz Toolkit
studio.mapbox.com
OS Open Greenspace
Boundary-Line
OS VectorMap District
here
Layers panel
Layer properties - Remove fill
Layer properties - Style Thames polygon
Layer properties - London outline
London borough outlines
London greenspace (point data)
Select color
Layer properties - London greenspace (point data)
Dot density map of London greenspace
Processing toolbox
Count points in polygon
Count points in polygon settings
Coubnt - Layers panel
NUMPOINTS -> Graduated
Symbol settings
Expression string builder
Layer properties - Count - Symbology
Proportional symbol map of London greenspace
Open attribute table
Start editing - Open field calculator
Count - Field calculator
Save edits
Symbol selector
Simple fill
Layer properties - Count - Symbology
Classification algorithms
Choropleth map of London greenspace
Manage and install plugins
Create gird layer
Grid settings
Count points in polygon
Count points in polygon settings
Layer properties - Count - Source
Query builder
Layer properties - Count - Symbology
Change colour
Hexbin map of London greenspace
Print layout
Add item
Item properties - Scale
Item properties - Legend
Complete hexbin map of London greenspace
Resources - Tilesets
New tileset
Select hex-with-counts.geojson
Choose a template
Add new layer
Custom layer
Source
Mapbox hex-with-counts
Type - Fill extrusion
Tilted black contextual map
Style across data range
Colour settings
Colour settings
Hexbin tilted map of London greenspace
Height - Style across data range
Height settings
3D hexbin map of London greenspace
Opacity
3d hexbin map of London greenspace with opacity
Mapbox hexbin map of London greenspace on mobile device