Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Show feature count" on a rule based renderer gives wrong result for the else statement (again) #27893

Open
qgib opened this issue Oct 10, 2018 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Regression Something which used to work, but doesn't anymore Symbology Related to vector layer symbology or renderers

Comments

@qgib
Copy link
Contributor

qgib commented Oct 10, 2018

Author Name: Harrissou Santanna (@DelazJ)
Original Redmine Issue: 20071
Affected QGIS version: 3.3(master)
Redmine category:symbology


This is a revival of #22013.
In the attached screenshots, I use the Else shortcut in one case and the full rule in the other. counted features are not the same:

1/ The "Route secondaire" level "instead of displaying 0" #27892, would return 296389 in one case (correct!) and, 304445 with the Else rule (corresponding to the whole layer).

2/ At the bottom of the rules, the Autres nature subclass should return 213037 features as of

@select count(nature) from layer where importance not in ('1','2') and nature not in ('Bac auto', 'Escalier','Piste cyclable','Sentier','Chemin')@

but it instead returns the same value shown at its upper level:

  • 296389 features which is the result of @select count(nature) from layer where importance not in ('1','2')@
  • or 304445 features with the Else rule used for "Route secondaire".

@qgib
Copy link
Contributor Author

qgib commented Oct 10, 2018

Author Name: Jürgen Fischer (@jef-n)


1/ The "Route secondaire" level "instead of displaying 0":https://issues.qgis.org/issues/20070, would return 296389 in one case (correct!) and, 304445 with the Else rule (corresponding to the whole layer).

2/ At the bottom of the rules, the Autres nature subclass should return 213037 features as of

@select count(nature) from layer where importance not in ('1','2') and nature not in ('Bac auto', 'Escalier','Piste cyclable','Sentier','Chemin')@

but it instead returns the same value shown at its upper level:

1/ The "Route secondaire" level "instead of displaying 0" #27892, would return 296389 in one case (correct!) and, 304445 with the Else rule (corresponding to the whole layer).

2/ At the bottom of the rules, the Autres nature subclass should return 213037 features as of

@select count(nature) from layer where importance not in ('1','2') and nature not in ('Bac auto', 'Escalier','Piste cyclable','Sentier','Chemin')@

but it instead returns the same value shown at its upper level:

  • 296389 features which is the result of @select count(nature) from layer where importance not in ('1','2')@
  • or 304445 features with the Else rule used for "Route secondaire".

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Symbology Related to vector layer symbology or renderers Regression Something which used to work, but doesn't anymore labels May 25, 2019
@alexbruy
Copy link
Contributor

Probably related to #30639

@Pedro-Murteira
Copy link

This is still valid on QGIS 3.22.4 and 3.24.0.

@phidrho
Copy link
Contributor

phidrho commented May 3, 2022

I've also noticed this on 3.24.2 (Win10)
I have prepared simple example in gpkg (includes project and data for testing):
else_count_bug.zip

ELSE count bug - with else containing features:
else_count_bug - with else containing features

ELSE count bug - with empty else (no features):
else_count_bug2 - with empty else (no features)

@Jeroen-GroeneBij
Copy link

Well, this saved me writing another bug report :)
The issue as shown by @phidrho is still or again valid in 3.34.3 on windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Regression Something which used to work, but doesn't anymore Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

No branches or pull requests

6 participants