Bug report #11914

"Rule-based renderer": refine current rules doesn't apply on the subset of features, but all the features in the layer

Added by Harrissou Santanna almost 6 years ago. Updated almost 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:20124

Description

Steps to reproduce:
- Layer Properties > Style < Rule-based
- Enter a valid expression. ok
- Enter a second rule (or Else rule if u want) and apply.
- then select the first rule and "refine current rules" by adding categories. choose the field to use and apply. You'll be rendered symbology for all the features in the current layer instead of just getting symbology on the features that follow the first rule. It's not really a refining.
Counting features will show zero for the categorized rows that don't follow the first rule but I think they shouldn't appear. Those rows won't appear in the canvas (due to 0 feature) and aren't really annoying except they appear in the TOC and also, more annoying, in composer legend.

But refining rules with ranges classify data, based to all features in the layer and not only those following first rule. This may lead to misunderstanding, real confusion and wrong information. More annoying.

I report this bug as blocker without having checked in previous release (sorry - I don't have any on this computer) but I'm pretty sure I've already used it as expected, in the past.

History

#1 Updated by Harrissou Santanna almost 6 years ago

I've found an use-case where it may be useful to keep categorization (and other refinings?) on all features instead of subset: in atlas mode.

Suppose the first rule is something like

field_1 = attribute($atlasfeature, 'coverage_field')

And you refine this rule with categorized symbols on field_2.
with the current system, You get all the rows/features in the layer and can order/modify their style as you want. While generating atlas, you don't have to care about how features will be displayed as you've already set it for all features in the layer.

If the categorized/range rows were about only filtered features, I think the features that don't match rule 1 (according to the $atlasfeature when setting) won't be shown to the user in style dialog and will be missed when iterating over coverage features.

Maybe, more than a bug, this report should be a feature request and an answer can be to add a checkbox in the dialog whether the refining might concern the subset or the whole layer?

#2 Updated by Giovanni Manghi almost 6 years ago

  • Affected QGIS version changed from 2.6.1 to master
  • OS version deleted (8.1)
  • Operating System deleted (Windows)
  • Target version deleted (Version 2.8)
  • Priority changed from Severe/Regression to Normal

Not a regression (tested down until qgis 2.0.1).

#3 Updated by Nyall Dawson almost 5 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

Duplicate of #10479

Also available in: Atom PDF