Bug report #17442
Categorized style issue using numeric fields with NULL values
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Alessandro Pasotti | ||
Category: | Symbology | ||
Affected QGIS version: | 2.18.14 | Regression?: | Yes |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 25339 |
Description
When a vector layer is classified using the categorized style on numeric fields with NULL values, unchecking the blank/NULL class (using shapefiles) or the "0" class (using other data formats) makes also the features of the other classes invisible.
Steps to replicate the issue:
- create a shapefile layer with a numeric (integer or real) field named A
- start editing
- add three features: the first with A=1, the second with A=2 and the third with A=NULL (no value)
- save and stop editing
- open the Vector Properties Dialog - Style tab (don't use the Layer Styling Dock)
- classify the layer using the categorized style on the field A: the classes "0", "1", "2" and "blank" are automatically created
- uncheck or remove the class "blank": all the features of the layer disappear
- uncheck or remove the class "0": the other checkboxes return to work properly
Using PostGIS, SpatiaLite or GeoPackage layers the behavior is slightly different. The "blank" checkbox works properly but unchecking the class "0" the features of the classes "1" and "2" disappear.
The issue doesn't occur:
- using the Layer Styling Dock
- saving and reopening the project with the style already set
The issue is OS independent and also occurs in QGIS 2.14.20 and QGIS 2.18.14.
Associated revisions
[bugfix] Categorized style issue using numeric fields with NULL values
Fixes #17442
[bugfix] Categorized style issue using numeric fields with NULL values
Backported from master PR 5720
Fixes #17442
History
#1 Updated by Giovanni Manghi about 7 years ago
- Regression? changed from No to Yes
- Affected QGIS version changed from master to 2.18.14
Ugly bug... wasn't an issue in 2.8 and 2.12... likely to have surfaced at some point in 2.14(?).
#2 Updated by Alessandro Pasotti almost 7 years ago
- Assignee set to Alessandro Pasotti
looking ... if you want to make life easier for developers, please always attach a minimal project and sample file to reproduce the issue.
#3 Updated by Alessandro Pasotti almost 7 years ago
sorry, ignore my previous comment, the manual creation of the layer is probably required to reproduce the issue.
#4 Updated by Alessandro Pasotti almost 7 years ago
- Status changed from Open to In Progress
- Pull Request or Patch supplied changed from No to Yes
PR: https://github.com/qgis/QGIS/pull/5720
Backport will follow ...
#5 Updated by Anonymous almost 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|29abd9d3f990a42c0f7e5a46c88e228fd032082b.
#6 Updated by Giovanni Manghi almost 7 years ago
- Resolution set to fixed/implemented