Tutorial: Styling Vector Data in QGIS Using Size-Scale Field

As you saw in this previous tutorial, there are many options available to style vector data in QGIS. But you may have noticed that all the basic method of styling vector layers uses only a single attribute or a single column from the attribute table. Usually GIS data is pretty rich in information and you have more than one useful attribute in your data layer. Presenting two or more of the attributes together can create a very useful map or communicate a powerful story. In this tutorial, we will explore using ‘size-scale field’ option to draw symbols whose area is proportional to an attribute.
We will use NOAA’s Significant Earthquake Database and import the CSV file as a points layer as described in this tutorial. We would like to create a map that shows both the intensity of the earthquake as well as number of deaths caused by it.

  • Load the earthquakes layer in QGIS. To visualize the points better, I also added 10m_admin_0_countries shapefile layer from the Natural Earth dataset.
  • We are interested in mapping 2 attributes - intensity and number of deaths. Select the earthquakes layer and open the attribute table by right clicking on the layer name and selecting ‘Attribute Table’. Look through the identify the relevant field names. The field names are INTENSITY and DEATH as shown.
  • You will see that there are several points which have either of the field values as 0. These will not be useful in mapping, so let’s select only those features that have non-zerovalues. Click on Advanced Search at the bottom of Attribute Table window and type in the query ‘INTENSITY != 0 AND DEATHS != 0’. Click OK.
  • Once you have a selection, switch to the QGIS canvas. Right click on the earthquake layer and select ‘Save selection as’. Name your output file ‘earthquakes_filtered.shp’.
  • Right click on the earthquakes layer and choose ‘Remove’. From Layers → Add Vector Layer, browse to the earthquakes_filtered.shp that we created in the last step and add it to the TOC.
  • Let us zoom into a country and try to style this layer. Use the Zoom In button to draw a rectangle around China and zoom to that region.
  • Right click on the earthquaked_filtered layer and select Properties. Tip: You can also double-click on the layer name to open the Properties dialog. In the Style tab, choose Graduated from the drop-down menu.
  • In the ‘Column’ field, choose the field ‘DEATHS’. This will be the first attribute we want to map. Choose ‘Oranges’ as the color ramp. We will use the Natural Breaks (Jenks) mode for classifying and use 5 classes. Once the options are set, click Classify. Click Apply and look at the QGIS canvas - you will see the points rendered in varying shades of orange depending on number of deaths caused.
  • Switch back to the Style tab. Now it is time to map our second attribute. Click Advanced at the bottom right of the window and hover your mouse over Size Scale Field. Once the menu pops-out, click on the checkbox next to the field ‘INTENSITY’. (This is a bit tricky and you can easily miss the correct menu.Take your time and verify you have selected the right field.)
  • Click OK and look at your canvas. You will see different sized circles in shades of orange. The size of the circle is determined by the INTENSITY field. You will notice that the circles are quite large and clutter our map. Let us reduce the size of the symbols.
  • Go back to the Properties dialog. In the Style dialog, click on ‘change’ button next to Symbol. In the Symbol selector, change the size to 1. Click OK. ( You have to use trial-and-error to judge what size would work best for your map.
  • Remember to click ‘classify’ once again after changing the symbol. Click OK and switch to the canvas to see the updated map. ( Note: I had to do this a couple of time before the change took place. Could be a bug )
  • We aren’t done just yet. You will notice that some lighter circles overlap and obscure the darker ones. Let’s fix that. Go back to the properties dialog and click on the symbols next to the classes.
  • In the Symbol selector, slide the transparency slider to about 75%. Do the same for first 3 classes. Leave the last 2 classes representing higher number of deaths to 0% transparency. Click OK.
  • Click OK on the Properties dialog and switch to the QGIS canvas. You now see 2 separate attributes mapped together on a single map. The map clearly shows where the worst earthquakes have hit and their relative intensity.
In case you were puzzled by the number of deaths for some points - you can check your attribute table and note that these happened a long time ago and hence the large number of estimated casualties.

Hope you learnt a new method of styling and it will give you ideas to present your GIS data in a new light.