2

enter image description hereIn the attribute table for a layer I have 13 Objects and if I switch on object number button. I have 16 Objects and this is wrong. I couldn´t find a way to correct this?

On the left side you see VK with 16 objects, but in the drawing there are only 13 red circles.

enter image description here

8
  • I don't understand the issue. Please add a picture.
    – kwoxer
    Commented Apr 2, 2015 at 10:13
  • 1
    The object numbering might contain objects that are already deleted. They still are in the shapefile's database, but hidden.
    – AndreJ
    Commented Apr 2, 2015 at 11:15
  • 1
    are you in an edit session ?
    – radouxju
    Commented Apr 2, 2015 at 18:21
  • @AndreJ: That could be right. So is there a way to delete the hidden objects?
    – ewald
    Commented Apr 7, 2015 at 7:31
  • @kwoxer: I add a picture.
    – ewald
    Commented Apr 7, 2015 at 7:32

2 Answers 2

2

If you close and re-open your project, the displayed number will be updated. If you remove and then add the layer again, the option 'Show feature count' is no longer activated.

3
  • sorry, but it dosn`t work. I closed the file und reopen it as you mentioned, but I have already 16 Objects. Also, when i remove the shapelayer and bring the layer again to Qgis 2.8.1. I have 16 Objects. It seem´s that the only way is to save the layer with another file name.
    – ewald
    Commented Apr 7, 2015 at 11:38
  • Do you mean closing the project or the layer? I have QGIS 2.8.1 and this works by closing the project... Anyway, good that you could find an answer.
    – wiltomap
    Commented Apr 7, 2015 at 11:42
  • I mean closing the project. But anyway thank you for your help
    – ewald
    Commented Apr 7, 2015 at 11:59
1

The object numbering might contain objects that are already deleted. They still are in the shapefile's database, but hidden.

Saving to another file name or file format, like spatialite, will leave out deleted objects.

To preserve your layer styling, you can copy the style from the old layer to the new one, then delete the old layer from the canvas.

4
  • Thank you. Sorry, but I am very new to Qgis. How can i copy the style from the old layer to the new one??
    – ewald
    Commented Apr 7, 2015 at 11:18
  • Right-click on your layer, then inside menu 'Style': click the 'Style' drop-down menu (at the bottom of the dialog) and eventually select 'Save Style > QGIS Layer style file'. This will produce a *.qml file. To set this style to your new layer, follow the same steps but select 'Load style' in the drop-down menu. Hope it's clear enough!
    – wiltomap
    Commented Apr 7, 2015 at 11:41
  • Thank you that works fine. see my picture. "testfile" is a copy of "Hausanschluß". "Testfile" has 114 Object and "Hausanschluß" has 122 Object. The difference are deleted Objects.
    – ewald
    Commented Apr 7, 2015 at 12:05
  • Alternatively, you have a Styleentry in the rightclick context menu, where you can copy and paste without saving the style to a file.
    – AndreJ
    Commented Apr 7, 2015 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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