[QGIS-Developer] Rule-based renderer: show symbol in the legend but don't use it for rendering

Alexander Bruy alexander.bruy at gmail.com
Wed Oct 24 11:05:09 PDT 2018


In a tree-like set of rules for rule-based renderer child rule is a combination
of its own symbol and rules with the parent symbols and rules. For example.
in the tree like this

 - child_a
    - child_a1
    - child_a2
 - child_b
   - child_b1
 - child_c
    - child_c1
 - child_d

child_a1 will be produced using rules from root_1, child_a and
child_a1. Same with symbols: they all will be rendered one by one.

I'm wondering is it possible in rule-based renderer to have a rule
active but with symbol excluded from the rendering process?

I know that it is possible to disable symbol for rule, but in this
case also nothing will be displayed in the legend and this is not
desirable in my case. I want to have symbol in the legend, but don't
want it to influence child rules/symbols.
This can be useful in geology, military and probably other cases where
"color-shape" legends are quite common, e.g. first feature clasees
defined by color
and then subclasses by different shape of the same color. Having color in the
legend makes it nuch easier to distinguis different clasess without expanding
child nodes in the legend.

If current implementation does not allow this does it make sense to
propose a patch for this, will it be accepted?

Alexander Bruy

More information about the QGIS-Developer mailing list