QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

Features count shows zero for 'all other values' when doing categorized symbology and features values are NULL

Open stefanon opened this issue 1 year ago • 2 comments

What is the bug or the crash?

When I apply a categorized symbology to a vector layer and the features values contain NULLs the features count when activated, shows a value of 'zero' features instead of the number of those with value NULL . The attribute values are A,B,C,D and NULL, and the style looks like in figure, where the 'all other values' count is set to zero:

image The same layer when applying a rule based style, inserting a rule for null values looks like :

image

Steps to reproduce the issue

Assign a categorized style to a vector layer for features that contain some NULL values, and then activate the 'show features count' for the layer.

Versions

QGIS version 3.30.1-'s-Hertogenbosch QGIS code revision 447e8d717a
Qt version 5.15.3
Python version 3.10.6
GDAL/OGR version 3.4.1
PROJ version 8.2.1
EPSG Registry database version v10.041 (2021-12-03)
GEOS version 3.10.2-CAPI-1.16.0
SQLite version 3.37.2
PDAL version 2.3.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Ubuntu 22.04.2 LTS
       
Active Python plugins
ProjectPackager 0.7.1
latlontools 3.6.9
GroupStats 2.2.7
batchvectorlayersaver 0.9
grassprovider 2.12.99
processing 2.12.99
db_manager 0.1.20
QGIS version 3.30.1-'s-Hertogenbosch QGIS code revision [447e8d717a](https://github.com/qgis/QGIS/commit/447e8d717a) Qt version 5.15.3 Python version 3.10.6 GDAL/OGR version 3.4.1 PROJ version 8.2.1 EPSG Registry database version v10.041 (2021-12-03) GEOS version 3.10.2-CAPI-1.16.0 SQLite version 3.37.2 PDAL version 2.3.0 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.4 QScintilla2 version 2.11.6 OS version Ubuntu 22.04.2 LTS

Active Python plugins ProjectPackager 0.7.1 latlontools 3.6.9 GroupStats 2.2.7 batchvectorlayersaver 0.9 grassprovider 2.12.99 processing 2.12.99 db_manager 0.1.20

Supported QGIS version

  • [X] I'm running a supported QGIS version according to the roadmap.

New profile

  • [x] I tried with a new QGIS profile

Additional context

No response

stefanon avatar Apr 14 '23 10:04 stefanon

I tested the issue with different dataproviders using QGIS 3.30.1 (Linux Mint 21.1) and managed to reproduce it with all tested dataproviders (scratch layer, postgis layer, geopackage). Integer fields work fine, so it seems to be a problem with a text field? I also noticed that counts do work correctly if the style is copied from layer to another. But reclassifying layer will set the count of "All other values" back to 0.

categorized-style-bug

rnousia avatar Apr 21 '23 11:04 rnousia

still an annoying bug. the feature count can also be updated by clicking into the 'all other values' field and save it.

jon-m-l avatar Apr 18 '24 13:04 jon-m-l