# Thematic Mapping Techniques

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 [OS Open Greenspace](https://www.ordnancesurvey.co.uk/products/os-open-greenspace) and created a centre point for each greenspace. We are also using some data from [Boundary-Line](https://www.ordnancesurvey.co.uk/products/boundary-line) and [OS VectorMap District](https://www.ordnancesurvey.co.uk/products/os-vectormap-district).

Let’s get started…

### QGIS

All the data for this workshop can be downloaded [here](https://github.com/OrdnanceSurvey/GeoDataViz-Toolkit/tree/master/Workshops/Thematic%20Mapping%20Techniques). 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.

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-a1698b9d88ed8987cf94b74153167bbf5638ff46%2F0%20(4).png?alt=media" alt="QGIS Layers Panel"><figcaption><p>Layers panel</p></figcaption></figure>

4. 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, then click ‘Simple fill’ and change the ‘Fill style’ to ‘No Brush’, like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-dd6ddf50099ab828c60691321b567d2c6130cc28%2F1%20(4).png?alt=media" alt="Layer Properties - remove fill"><figcaption><p>Layer properties - Remove fill</p></figcaption></figure>

Click ‘OK

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-28daca13700addf7d783f3f41b10550fcfcb40f3%2F2%20(4).png?alt=media" alt="Layer properties - Style Thames polygon"><figcaption><p>Layer properties - Style Thames polygon</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-8a8592890435748d137379f52eb6c05aa577694d%2F3%20(4).png?alt=media" alt="Layer properties - London outline"><figcaption><p>Layer properties - London outline</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-7ddd508525d095cb3f78d33014f7d7b1ad9f1d15%2F4%20(4).png?alt=media" alt="map of London borough outlines based on previous layer property decisions"><figcaption><p>London borough outlines</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-065c2468978a9bd9436c58291cf12880d67fb4a9%2F5%20(2).png?alt=media" alt="Point data for Greenspaces in London"><figcaption><p>London greenspace (point data)</p></figcaption></figure>

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

8. 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%:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-ace17adf2d8c8571e76f05d19d6b63e2f3a96b5c%2F6%20(4).png?alt=media" alt="Select Colour dialogue box in QGIS"><figcaption><p>Select color</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-e5cd4e61bc45a98ddd26a3685cf3f82e89d970fe%2F7%20(3).png?alt=media" alt="Symbology panel in Layer Properties with Simple Marker, Size 1.4, stroke style No Pen and blending mode by feature set to Multiple"><figcaption><p>Layer properties - London greenspace (point data)</p></figcaption></figure>

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 [here](https://www.ordnancesurvey.co.uk/blog/carto-tips-using-blend-modes-opacity-levels#respond).)

With a couple of simple colour techniques we have created a nice <mark style="color:red;">**dot density map**</mark> 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:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-ad0cba710bbc14faae6b821fca3b90bed1c8f4ce%2F8%20(3).png?alt=media" alt="Dot density map of London greenspace"><figcaption><p>Dot density map of London greenspace</p></figcaption></figure>

Next, we’re going to explore some options for aggregating the data, and we’ll start with a <mark style="color:red;">**proportional symbol map**</mark>.

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

9. 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’:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-e3dc8ba5a66df7be620e72174191fb94593621da%2F9%20(3).png?alt=media" alt="Location of the Processing toolbox in QGIS"><figcaption><p>Processing toolbox</p></figcaption></figure>

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

10. In the ‘Processing Toolbox’ search for <mark style="color:red;">**count points**</mark>.

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-ed414915c08de7420efa8ceffec49fa72b2882d6%2F10%20(3).png?alt=media" alt="Finding the Count points in polygon tool"><figcaption><p>Count points in polygon</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-ee74d7dde103676b423fe4c09bea6a7a4a1f3dee%2F11%20(3).png?alt=media" alt="Count points in polygon dialogue box"><figcaption><p>Count points in polygon settings</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-bf851759765337b9f95057bfcf9d76534608e785%2F12%20(3).png?alt=media" alt="New Count layer in the Layers panel"><figcaption><p>Count - Layers panel</p></figcaption></figure>

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

12. 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’

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-40c1001fea7cff8542fe34ee3141a39aa220fb6c%2F13%20(3).png?alt=media" alt="Symbology styling as Graduated by NUMPONTS"><figcaption><p>NUMPOINTS -> Graduated</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-d9ee0c744519de75abe3a95bd424a411e534c434%2F14%20(3).png?alt=media" alt="Symbol setting for Centroid Fill"><figcaption><p>Symbol settings</p></figcaption></figure>

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…’:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-61a89fb1cd7f220aed41b37730b245035a8be0d4%2F15%20(3).png?alt=media" alt="Data defined override’ button next to ‘Size’ and click ‘Edit…&#x27;"><figcaption></figcaption></figure>

14. 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.*

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-28b4d90b9584289a8accf3e6a50e6e11b65509c6%2F16%20(3).png?alt=media" alt="Expression String Builder dialogue window"><figcaption><p>Expression string builder</p></figcaption></figure>

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

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

Then click ‘Classify’

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-16169c8a065354219fde3b7e81eb2b90a92987e2%2F17%20(3).png?alt=media" alt="Layer properties - Count - Symbology"><figcaption><p>Layer properties - Count - Symbology</p></figcaption></figure>

By default, this adds in 5 classes using the ‘Equal Interval’ algorithm (you can read more about the different options [here](https://gis.stackexchange.com/questions/141139/what-is-the-theory-behind-graduated-symbols-in-qgis)).

Your **proportional symbol map** should look like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-0fc852123de6d3475c81be463558abb55e0efdfa%2F18%20(3).png?alt=media" alt="Proportional symbol map of London greenspace"><figcaption><p>Proportional symbol map of London greenspace</p></figcaption></figure>

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.

16. 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’:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-af065cf79d944225cc53cb0af62c5bc8fddcb6c6%2F19%20(3).png?alt=media" alt="Open attribute table for Count Layer"><figcaption><p>Open attribute table</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-6c3a4736aac34e9029c545795a7670af467016ca%2F20%20(3).png?alt=media" alt="Start editing - Open field calculator"><figcaption><p>Start editing - Open field calculator</p></figcaption></figure>

18. 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.*

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-14cbf223358f1b43620dde392e2958bf67164982%2Fimage%20(16).png?alt=media" alt="Count - Field calculator"><figcaption><p>Count - Field calculator</p></figcaption></figure>

Click ‘OK’

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-89815ff356f7d663eb69f7e3a2789dad7e6c2821%2Fimage%20(17).png?alt=media" alt="Saving Edits"><figcaption><p>Save edits</p></figcaption></figure>

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

20. 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’:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-6b8b66dbbfb3f24e9b1971b1ec7d3b86edc2f0c0%2Fimage%20(18).png?alt=media" alt="Symbol selector dialogue"><figcaption><p>Symbol selector</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-66effbd831e720888337472de7d02f682302398d%2Fimage%20(19).png?alt=media" alt="Symbol Settings - Simple fill"><figcaption><p>Simple fill</p></figcaption></figure>

Click ‘OK’

22. In the ‘Layer Properties’ panel. Change the ‘Column’ to <mark style="color:red;">**perkm2**</mark> and click ‘Classify’

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-ce0989fee805b02730195288729375ed23e23f41%2Fimage%20(20).png?alt=media" alt="Layer properties - Count - Symbology"><figcaption><p>Layer properties - Count - Symbology</p></figcaption></figure>

Feel free to experiment with the different classification algorithms:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-a60bb8b035321265eacaadf81dd1cb05e6240799%2Fimage%20(21).png?alt=media" alt="Classification algorithms"><figcaption><p>Classification algorithms</p></figcaption></figure>

Click ‘OK’ and you have a <mark style="color:red;">**choropleth map**</mark> which should look something like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-9b5771660b34ecf1289bd8716b673ea01cba8660%2Fimage%20(22).png?alt=media" alt="Choropleth map of London greenspace"><figcaption><p>Choropleth map of London greenspace</p></figcaption></figure>

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.

Next we’re going to look at using a regular grid. We’re going to use hexagons to create a <mark style="color:red;">**hexbin map**</mark>. [Read this](https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-statistics/h-whyhexagons.htm) for more information about the benefits of using Hexagons over other tessellating shapes such as squares.

23. 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’

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-88c3da98828646862b90b02e6d52d848b4fe1af9%2Fimage%20(23).png?alt=media" alt="Plugins - Manage and install plugins"><figcaption><p>Manage and install plugins</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-606e988ad2845bf1da8b50707a68f5fa954b7609%2Fimage%20(24).png?alt=media" alt="MMQGIS - Create - Create Grid Layer"><figcaption><p>Create Grid Layer</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-43bf19013d6e4d6684c66814b2b2800b06319238%2Fimage%20(25).png?alt=media" alt="Grid dialogue box"><figcaption><p>Grid settings</p></figcaption></figure>

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

25. 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:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-e838c4bc0b864cb98e163efc1b62ed3ac09e4b54%2Fimage%20(26).png?alt=media" alt="Processing Toolbox - Count points in polygon tool"><figcaption><p>Count points in polygon</p></figcaption></figure>

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.

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-407ee9ca5bf204c6a6970240e3bbd4b499969e90%2Fimage%20(27).png?alt=media" alt="Count points in polygon settings"><figcaption><p>Count points in polygon settings</p></figcaption></figure>

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

26. 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’:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-7071bb4d11c86526f41a3d523d0ab33869947dc5%2Fimage%20(28).png?alt=media" alt="Layer properties - Count - Source dialogue"><figcaption><p>Layer properties - Count - Source</p></figcaption></figure>

27. Add the expression:

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-db3e72b348c2d1ae1b038c1c6fcb160563cae734%2Fimage%20(29).png?alt=media" alt="Query builder dialogue"><figcaption><p>Query builder</p></figcaption></figure>

Click ‘OK’

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

Change the style settings so they look like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-86d1ecd3b35a3b214e446ae5d07885156730abf4%2Fimage%20(30).png?alt=media" alt="Layer properties - Count - Symbology"><figcaption><p>Layer properties - Count - Symbology</p></figcaption></figure>

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**

These colours are from our [GeoDataViz Toolkit](https://github.com/OrdnanceSurvey/GeoDataViz-Toolkit/tree/master/Colours).

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-fe1f2d0fac95d09d7075b56282832525691413c6%2Fimage%20(31).png?alt=media" alt="Change colour"><figcaption><p>Change colour</p></figcaption></figure>

*Please feel free to choose a different colour palette.*

When you’re happy, click ‘OK’.

Your map should look something like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-d39445f55f8a121f2d321eea4cc60afa482015dc%2Fimage%20(32).png?alt=media" alt="Hexbin map of London greenspace"><figcaption><p>Hexbin map of London greenspace</p></figcaption></figure>

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.

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-80a9ca96e76ea6d22e94ef9b462f55eb1dcd5ef0%2Fimage%20(33).png?alt=media" alt="Project - New Print Layout"><figcaption><p>Print layout</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-d334f8b87eceea70d610431456ff4f52f4c273ea%2Fimage%20(34).png?alt=media" alt="Adding Items in the Layout"><figcaption><p>Add item</p></figcaption></figure>

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.

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-8b62caa794f204c62bdbfcaa62c025576033a7f2%2Fimage%20(35).png?alt=media" alt="Item Properties - Scale"><figcaption><p>Item properties - Scale</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-610a48679c878e39f5a41f2263fe705c4be68a1e%2Fimage%20(36).png?alt=media" alt="Item properties - Legend"><figcaption><p>Item properties - Legend</p></figcaption></figure>

Your layout might end up looking something like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-c44b4502fa4ba03c38a8f1e5b21b1ac3de9abf62%2Fimage%20(37).png?alt=media" alt="Complete hexbin map of London greenspace"><figcaption><p>Complete hexbin map of London greenspace</p></figcaption></figure>

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

1. In a web browser, preferably Google Chrome, go to [studio.mapbox.com](https://studio.mapbox.com/).

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

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-d2a44d9e44df8bd3a6ce463205742311e02d8ecb%2Fimage%20(38).png?alt=media" alt="Resources - Tilesets"><figcaption><p>Resources - Tilesets</p></figcaption></figure>

3. Click on ‘New Tileset’

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-cef43e355f26bb27c754d08cfdbf2b47740f546a%2Fimage%20(39).png?alt=media" alt="New tileset"><figcaption><p>New tileset</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-b2b5131316baeef4d652eca21c17cf2e360cab7b%2Fimage%20(40).png?alt=media" alt="Select hex-with-counts.geojson"><figcaption><p>Select hex-with-counts.geojson</p></figcaption></figure>

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.

5. Now we’re going to create a new map. Click on the ‘Styles’ tab on the right-hand menu and then click ‘New style’
6. Select ‘Monochrome’ and then ‘Dark’. The click ‘Customize Monochrome’

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-a54c6ea2b54976fb6859fe0b6044e5c3528278b0%2Fimage%20(41).png?alt=media" alt="Choose a template"><figcaption><p>Choose a template</p></figcaption></figure>

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.

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-7dcb9fe450a3c85f48f0cc56c18c42df56dd769b%2Fimage%20(42).png?alt=media" alt="Add new layer"><figcaption><p>Add new layer</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-77e28b4d11941845f56af474b4b5fd6e24f51088%2Fimage%20(43).png?alt=media" alt="Custom Layer"><figcaption><p>Custom layer</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-db0baf0ac7eb0248c796d9f5b8eea9791134558a%2Fimage%20(44).png?alt=media" alt="Source dialogue box"><figcaption><p>Source</p></figcaption></figure>

You should now have something that looks like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-4c2368688ba4b8dd0c93a80670a26d1a81115d76%2Fimage%20(45).png?alt=media" alt="Mapbox hex-with-counts"><figcaption><p>Mapbox hex-with-counts</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-8ddb050028e0ce78ed357d6f9e99d5a644e3c38b%2Fimage%20(46).png?alt=media" alt="Type - Fill extrusion"><figcaption><p>Type - Fill extrusion</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-e984a48d715c4620bd0259c9346e0f9e00e11b7e%2Fimage%20(47).png?alt=media" alt="Tilted black contextual map"><figcaption><p>Tilted black contextual map</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-18760a0015e6a3e1f45357a7fe403d81977b8656%2Fimage%20(48).png?alt=media" alt="Setting the style across data range"><figcaption><p>Style across data range</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-83d9be142560bc10e700d1220ebe92ee35fc826f%2Fimage%20(49).png?alt=media" alt="Colour settings"><figcaption><p>Colour settings</p></figcaption></figure>

14. 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:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-cd1b719cfde85ff72f970d60c8eaef9b82fde18a%2Fimage%20(51).png?alt=media" alt="Colour settings"><figcaption><p>Colour settings</p></figcaption></figure>

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-270aa6b08f9b8bb91a9eeab22bc3d9a7f3e399bf%2Fimage%20(52).png?alt=media" alt="Hexbin tilted map of London greenspace"><figcaption><p>Hexbin tilted map of London greenspace</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-e7217652181450ea1e011e9dde5293f760f9f2b8%2Fimage%20(53).png?alt=media" alt="Height - Style across data range"><figcaption><p>Height - Style across data range</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-a971fa848f4cebd3f17002d9ae42d5407047e564%2Fimage%20(54).png?alt=media" alt="Height - Style across data range"><figcaption><p>Height settings</p></figcaption></figure>

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

Your settings and map should now look like this:

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-322ed716f3b59fcb9d58702ae221b74cfb9e21d9%2Fimage%20(55).png?alt=media" alt="3D hexbin map of London greenspace"><figcaption><p>3D hexbin map of London greenspace</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-51b66d0c6bef81664b7eacb297d041ee2564aa46%2Fimage%20(56).png?alt=media" alt="Opacity settings"><figcaption><p>Opacity</p></figcaption></figure>

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-c3e3b39187fe7ec974df28007c652b076bf1d23b%2Fimage%20(57).png?alt=media" alt="3d hexbin map of London greenspace with opacity"><figcaption><p>3d hexbin map of London greenspace with opacity</p></figcaption></figure>

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.

19. 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’.

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

<figure><img src="https://3774974716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzIfdYInJITdcxaLLMhlD%2Fuploads%2Fgit-blob-614ef709c089bb3e58477bfe7a4a78d0ad73e20c%2Fimage%20(58).png?alt=media" alt="Mapbox hexbin map of London greenspace on mobile device"><figcaption><p>Mapbox hexbin map of London greenspace on mobile device</p></figcaption></figure>
