4

I am using QGIS version 2.14.1 (Essen). I have symbols that I have classified according to certain value from one of the columns in my shapefile.

Is it possible to do a second classification according to a second column?

Basically, I am using data with road works and the deviations linked to roadworks. My first classification is according to the size of the roadwork and I would like the second one to be according to the type of deviation (for cars, pedestrians, buses, etc).

  • You want to display both symbols at the same time and on the same feature? – Hasan Mustafa Apr 21 '16 at 7:57
  • Yes that is exactly what I want to do. One symol is dependant on one column and the other is dependant on another colum..... – philippe Apr 21 '16 at 8:01
  • add the layer twice – Ian Turton Apr 21 '16 at 8:06
  • yes i guess so, the problem then is all the symbols will be overlapping one another (althugn I can change this manually of course).. – philippe Apr 21 '16 at 8:08
  • @HasanMustafa Yes that is exactly what I want to do. One symol is dependant on one column and the other is dependant on another colum... – philippe Apr 21 '16 at 8:41
7

You can use Data defined override in combination with categorised symbology. With this approach you can do categorised symbology on one attribute and set some other parameter (line style, line width etc.) to change according to other attributes.

example on OSM road data:

  • classified by attribute "type" (line color)

enter image description here

  • change the symbol and choose some parameter, click on Data defined override button and write your formula or condition (in this case "maxspeed" /10). You can also use CASE WHEN condition THEN result ELSE result END etc. For possible parameter values see Description.. in parameter context menu

enter image description here

  • result

enter image description here

  • where do i find the "data defined override" button? I'musing QGIS in french so not sure whivh button I am looking for. – philippe Apr 21 '16 at 8:49
  • it's the small icon next to value of parameter, see where I click on second screenshot. When you set your definition the icon change to "epsilon" sign – Oto Kaláb Apr 21 '16 at 8:57
  • Sorry but I didn't get the screenshot! – philippe Apr 21 '16 at 9:06
  • I meant screenshot in my answer, but look here: postimg.org/image/47w03kbnb – Oto Kaláb Apr 21 '16 at 9:25
3

You can add offsets to avoid overlapping symbols:

  • Add the layer twice as suggested by @iant♦
  • When defining the style you can go to the Symbol selector for each symbol and set an offset for it.

Offset settings Set desired offset here

Offset points Duplicated layer with point symbols and offset

  • Yes thanks, you are right, at the moment i see this as the best solution! – philippe Apr 21 '16 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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