2

I'm using a .csv detailing types of renewable energy in the UK. I want to display them as different colours for the types of energy (e.g. wind, solar, gas etc.) but also a different size symbol based on the energy output.

All the information is in the .csv file and I am able to perform these two styles independently, but I can't work out how to do this together. I'm new to GIS so just getting the hang of things!

5

Thats not difficult to do but a little tricky.


Option 1

  1. First open symbology menu of your layer and create a categorized symbology.

enter image description here

  1. Now click on categorized and change it to rule-based.

enter image description here

As you can see your categories are converted to rules.

  1. Now you can add a graduated renderer to each rule. Mark a category and click on Refine Selected Rules and choose Add Ranges to Rule.

enter image description here

  1. Now set up the graduated style as you like and click ok.

enter image description here

  1. I suggest to now remove the symbol of the category. Doubleclick it an uncheck Symbol (it is not absolutely necessary, but I suggest to do so):

enter image description here

  1. The result:

enter image description here

enter image description here


Option 2

In case you have houndreds of categories I suggest to add the style to each feature and use data defined override like this:

  1. Choose Categorized in Symbology menu and click Change.... Now click on Data defined override next to size (or color) and choose Assistant.

enter image description here

  1. Choose your field you want to the graduated renderer to be based on. Then choose min/max values (automatically or manually).

enter image description here

  1. Finally Classify your symbols. The result:

enter image description here

enter image description here

Using option 2 there is no legend showing the size. Also see Why are size-scaled symbols missing from map layout legend?

  • Perfect, thank you so much! – Wiredchild Jan 12 at 16:09
  • Bizarrely, both the Categorize and Graduated style options have stopped working for the .csv file I am using, despite the file not changing. I have tried starting a new map and it doesn't make a difference, I'm wondering if this is a bug? – Wiredchild Jan 12 at 19:44
  • @Wiredchild Can't really tell from here. Only guess I can make: Make sure to use the correct decimal separator when loading the CSV. There is a checkbox you need to tick when they are separated by comma. Otherwise the fields are not correctly recognized as numeric. On a second thought that does not explain why categorized does not work. – MrXsquared Jan 12 at 21:13
  • Hi, I've just sorted it thanks it wasn't recognising the field! However, the symbols I applied to the categorization (a series of different shapes) when I use the rule-based to add graduate these categories these aren't the symbol that becomes larger/smaller based on the value. They all become circles, how can I stop this? Thanks for your help it is much appreciated! – Wiredchild Jan 12 at 21:15
  • This is after categorization and these are the symbols i want to change size in-line with the graduation values I'm using: imgur.com/qwxAgn9 Instead, this happens: imgur.com/n44hxee – Wiredchild Jan 12 at 21:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.