qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.35k stars 2.98k forks source link

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

Open qgib opened 5 years ago

qgib commented 5 years ago

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:


qgib commented 5 years ago

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:

alexbruy commented 4 years ago

Probably related to #30639

Pedro-Murteira commented 2 years ago

This is still valid on QGIS 3.22.4 and 3.24.0.

phidrho commented 2 years ago

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 commented 7 months ago

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