Bug report #12092

Feature Count does not update properly on categorized features

Added by Yannick Portier about 5 years ago. Updated about 1 year ago.

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

Description

Note:
this only happens when the filter is added from the TOC right click context menu. It works ok if the filter is added by entering the vector layer properties.


When using a Categorized Styling on a Vector layer (source is a CSV file) and a Filter on the same layer, the overall Feature Count updates correctly but the counts of each categories does not update when changing the Filter.
It is updated correctly when loading the project however.

I am using QGIS 2.7 (1eec3b9) on Win64

Data.csv Magnifier (383 Bytes) Yannick Portier, 2015-01-30 08:21 AM

nofilter.png (2.9 KB) Yannick Portier, 2015-01-30 08:21 AM

withfilter.png (2.88 KB) Yannick Portier, 2015-01-30 08:21 AM

History

#1 Updated by Giovanni Manghi about 5 years ago

  • Category set to Vectors
  • Status changed from Open to Feedback
  • Affected QGIS version changed from 2.6.0 to master

Cannot confirm here on master and data of my own (csv). Please attach sample data and details about symbology and filter used.

#2 Updated by Yannick Portier about 5 years ago

1. Load the dummy Data.csv attached using the "Add Delimited Text Layer" button (File format "CSV", X field "Easting" Y field "Northing") and the following options enabled:
- First record has field name
- Use Spatial Index
- Watch File
2. CRS used was WGS84 / UTM zone 35N (32635)
3. Set Layer Properties / Style to "Categorized" using "Field 1" (click Classify" and remove the empty category)
4. Right-Click the Layer and tick "Feature Count"
5. Right-Click the Layer and choose "Filter..."
6. Set the expression to: "Field 3" = 2

After step 4, I get nofilter.png which is fine
After step 6, I get withfilter.png which does not look fine

#3 Updated by Giovanni Manghi about 5 years ago

Yannick Portier wrote:

1. Load the dummy Data.csv attached using the "Add Delimited Text Layer" button (File format "CSV", X field "Easting" Y field "Northing") and the following options enabled:
- First record has field name
- Use Spatial Index
- Watch File
2. CRS used was WGS84 / UTM zone 35N (32635)
3. Set Layer Properties / Style to "Categorized" using "Field 1" (click Classify" and remove the empty category)
4. Right-Click the Layer and tick "Feature Count"
5. Right-Click the Layer and choose "Filter..."
6. Set the expression to: "Field 3" = 2

After step 4, I get nofilter.png which is fine
After step 6, I get withfilter.png which does not look fine

it works as expected here. Are you using the latest master version available?

#4 Updated by Harrissou Santanna about 5 years ago

Just updated my master version (c19eb60 on Win 32bits) and got the same results than Yannick (with his data and my own). This issue happens also with QGIS Brighton. you need to reopen the layer's Properties dialog and validate before you get corresponding values.

I did another test : using the options proposed by Yannick, I filtered the layer, categorized it, counted values and then erased the filter request. The count didn't update. Need also to open layer's properties and apply before getting right values.

But I think I narrowed the issue. This bug happens when you right-click on layer and choose filter button. But all goes well if you filter the layer using layer's properties > General > Feature request.

#5 Updated by Yannick Portier about 5 years ago

I updated again (c19eb60 and now fe27b63) and issue is still there on my Win64.
But I agree with Harrissou: issue occurs only when right-clicking and using "Filter..." not when opening the layer properties dialog.

#6 Updated by Giovanni Manghi about 5 years ago

  • Status changed from Feedback to Open

#7 Updated by Giovanni Manghi almost 3 years ago

  • Regression? set to No
  • Easy fix? set to No

#8 Updated by Giovanni Manghi about 1 year ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF