In QGIS, I have a point-layer with a column named type, which contains around 10 different pipe-seperated possible values (for example A|B|D|E, A|B, B|C|Eor B|C and so on, like in the example-image) (the values represent different tracks and signs of mammal-species).

For each different value I want a defined symbol to be shown, but without any gaps between.

I have managed to build a symbology with seperate symbol-levels with different fixed offsets for each value, wich sizes are set feature-driven with expressions like

WHEN regexp_matches ("type", 'A')

This gives me desired symbols, but with a fixed offset for each symbol, which leads to gaps between them whenever a value is missing (for example if the type column says A|C, there is a gap between the symbols A and C, because the value B is not present).

enter image description here

Despite being quite complicated, this approach doesn't give me the wanted gap-free symbology... I have looked up the thread Labelling features by multiple attributes in QGIS, but this approach needs a separate column for each possible value, which in my case would need a bit of pre-formatting.

  • 1
    Using the answer that you have linked, you can compute the offset by counting the number of | before the icon/class being rendered
    – JGH
    Commented Mar 14, 2022 at 12:41
  • ok, that sounds like a good approach... How exactly would the syntax look like?
    – Bjoern
    Commented Mar 15, 2022 at 7:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.