QGIS (2.12.3, running on Windows) increases the feature count of a vector layer when I "save layer edits".

If I do the following steps:

  • create a Vector layer (shp file)
  • enable "show feature count" for that layer
  • add a single line: feature count goes to "1"
  • Use "split features" to make it into two features: feature count goes to "2"
  • use "merge selected features"to make it one feature again: feature count goes back to "1".
  • do a "save layer edits": feature count now jumps to "3".

It's the last jump to "3" I don't understand. I would assume that simply saving my edits shouldn't change the feature count, and I don't understand why "3".

If I move the lines around a bit after the split but before the merge and look at the final result with other tools (e.g. geoserver), it appears that there are indeed interim results in the file.

Is this a bug or is it another issue perhaps, what's going on?

  • What happens if you do a 'save as'? – SpatialSuccess Feb 15 '16 at 3:48

I found this bug report, which is probably the same as my problem. To summarize: shp-files can get corrupted when features are deleted (in my case probably a side-effect of the 'merge' action); it's a known problem; they're working on it; it's expected to be fixed in the next 2.14 release.

And @spatialSucces: if I do "save as", the saved file appears to be correct. So for the time being that might be a work-around.

| improve this answer | |

Yes, this is a bug - see this related question: Deleted polygons seem to revert to older versions.

I gather this issue will be fixed in the soon to be released version 2.14.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.