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

Wrong feature count after edit #18967

Closed
qgib opened this issue Jun 11, 2014 · 24 comments
Closed

Wrong feature count after edit #18967

qgib opened this issue Jun 11, 2014 · 24 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Jun 11, 2014

Author Name: Saber Razmjooei (@saberraz)
Original Redmine Issue: 10560
Affected QGIS version: master
Redmine category:data_provider/ogr


Feature count in QGIS master (21f0b4f) reports wrong number of features after edit.
To reproduce:

  • Open a vector layer
  • Right-click on the layer from layer tree and enable Feature count (the number of features is correct at this stage)
  • Toggle editing
  • Add or delete features (number of features is still correct)
  • Save edits

Feature count resets to the original number

The bug is not in 2.2



Related issue(s): #19349 (relates), #20772 (relates)
Redmine related issue(s): 11007, 12660


@qgib
Copy link
Contributor Author

qgib commented Jun 12, 2014

Author Name: Martin Dobias (@wonder-sk)


  • assigned_to_id was configured as Martin Dobias

@qgib
Copy link
Contributor Author

qgib commented Jun 13, 2014

Author Name: Martin Dobias (@wonder-sk)


Fixed in changeset "f581e20c44d746590a9454f397218ebe501e6a9c".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Nov 26, 2014

Author Name: Steve Lowman (Steve Lowman)


This bug is occurring in 2.6.


  • fixed_version_id was configured as Version 2.6
  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Nov 26, 2014

Author Name: Giovanni Manghi (@gioman)


Steve Lowman wrote:

This bug is occurring in 2.6.

cannot confirm on qgis master, please give it a try and report back.


  • version was changed from 2.2.0 to 2.6.0
  • status_id was changed from Reopened to Feedback
  • fixed_version_id removed Version 2.6

@qgib
Copy link
Contributor Author

qgib commented Nov 27, 2014

Author Name: Nyall Dawson (@nyalldawson)


I can confirm this on master, when editing a shapefile.

@qgib
Copy link
Contributor Author

qgib commented Feb 10, 2015

Author Name: Martin Dobias (@wonder-sk)


I confirm it too - it's the same problem like in #19349 and #20195 with shapefiles that have not been repacked


  • assigned_to_id removed Martin Dobias
  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Feb 13, 2015

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


  • category_id was configured as Data Provider/OGR

@qgib
Copy link
Contributor Author

qgib commented May 21, 2015

Author Name: Saber Razmjooei (@saberraz)


Works fine in 2.8.2.


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented May 21, 2015

Author Name: Steve Lowman (Steve Lowman)


I tested it in 2.8.2. The bug still exists.
I paste a couple of copied features into the layer. The count changes from 0 to 2. All good so far.
I save the change. The count stays at 2. All correct still.
I delete one of the features. The count reduces to 1. Still good.
I save the change. The count changes back to 2. Oh dear, not so good.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented May 21, 2015

Author Name: Giovanni Manghi (@gioman)


  • version was changed from 2.6.0 to master
  • os_version was changed from 7 to
  • operating_system was changed from Windows to

@qgib
Copy link
Contributor Author

qgib commented May 28, 2015

Author Name: Matthias Kuhn (@m-kuhn)


Pull request ready.

#2086

Most relevant discussion can be found in:
#19349

@qgib
Copy link
Contributor Author

qgib commented May 28, 2015

Author Name: Matthias Kuhn (@m-kuhn)


Fixed in changeset "7d7cdcd376c0d3fa60af1403a91e1e611b210174".


  • status_id was changed from Reopened to Closed

@qgib
Copy link
Contributor Author

qgib commented May 31, 2016

Author Name: Steve Lowman (Steve Lowman)


This bug is occurring again in 2.14.3. Feature count has been working fine for a while, but whatever the change that fixed it, it seems to have been reversed.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented May 31, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)


Feature count for shape files seems to work properly here on Ubuntu 16.04 LTS (1:2.14.3+git20160529+7d7467f+24xenial). Can you provide a list of steps to reproduce the issue?

@qgib
Copy link
Contributor Author

qgib commented Jun 1, 2016

Author Name: Steve Lowman (Steve Lowman)


Yep, I'm in W10. How to reproduce this...

  1. New project file.
  2. New shapefile layer.
  3. Check 'Show Feature Count' for new layer.
  4. 'Add Features' tool, digitise some features, e.g. 2 features. (Feature Count updates correctly - reads '2').
  5. Save Layer Edits. (Feature Count stays correct - reads '2').
  6. Digitise one more feature, and save layer edits. (Feature Count still correct - reads '3').
  7. Select and delete one of your features. (Feature Count reduces correctly - reads '2').
  8. Save Layer Edits. (Feature Count incorrectly reverts to previous value - reads '3').

@qgib
Copy link
Contributor Author

qgib commented Jun 2, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)


Hi Steve, thanks for your reply. I can't confirm this issue on Ubuntu 16.04 LTS (see screencast).


  • 9996 was configured as 10560_qgis-2-14-3.mp4

@qgib
Copy link
Contributor Author

qgib commented Jun 2, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)


Steve Lowman wrote:

  1. Save Layer Edits. (Feature Count incorrectly reverts to previous value - reads '3').

I can confirm this on Win7 (QGIS 2.14.3)!

Related: #22812 - Feature count issue (PostGIS view)

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2016

Author Name: Andreas Neumann (@andreasneumann)


I just tested this with a shapefile on Windows 7 with QGIS 2.15 (master) and QGIS 2.14 (#10902d17e ) and aren't able to reproduce this issue.

@reinhard and/or Steve: can you please test with #10902d17e - you can install it using the OSGeo4W installer (http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe) by chosing "QGIS Rel Dev" in the "Desktop" section.


  • 10112 was configured as qgis-rel-dev.png

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2016

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Reopened to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2016

Author Name: Giovanni Manghi (@gioman)


this is very likely related to #19349

the issue has been solved in master and backported to the development branch of 2.14


  • status_id was changed from Feedback to Closed
  • resolution was changed from to fixed/implemented

@qgib
Copy link
Contributor Author

qgib commented Jun 30, 2016

Author Name: Reinhard Reiterer (Reinhard Reiterer)


I've done the steps above in QGIS 2.15 master 600ff4f and 'Show Feature Count' works as expected.

(Win7)

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2016

Author Name: Ervin Wirth (Ervin Wirth)


The problem still exist with 2.16.2 after removing some features with PyQGIS codelines and commit changes.
Windows 7 x64.


  • status_id was changed from Closed to Reopened
  • 10439 was configured as qgisissue.png

@qgib
Copy link
Contributor Author

qgib commented Oct 7, 2016

Author Name: Even Rouault (@rouault)


@ervin, could you provide a self contained script + dataset that reproduces the issue ?


  • status_id was changed from Reopened to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 19, 2016

Author Name: Matthias Kuhn (@m-kuhn)


@ervin, make sure you use the layer.add/remove/etcFeature() methods and not layer.dataProvider().add/remove/etcFeature() methods.

Will close this until someone can provide a script/data to reproduce.


  • status_id was changed from Feedback to Closed

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! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant