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

Deleting columns in duplicate layer also deletes them in original layer #21808

Closed
qgib opened this issue Nov 6, 2015 · 1 comment
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@qgib
Copy link
Contributor

qgib commented Nov 6, 2015

Author Name: Michael Kirk (@michaelkirk)
Original Redmine Issue: 13782
Affected QGIS version: 2.12.0


I want to export a subset of my features/attributes to geojson so that I can use them in a web map.

Given I've got a shapefile layer "cities" with attributes "important_stuff" and "irrelevant_stuff"
And I duplicate the layer to "cities_copy"
And I enable edit mode on "cities_copy"
And I open the attribute table for "cities_copy"
And I delete the "irrelevant_stuff" column from "cities_copy"
Then I see only the column "important_stuff" in the cities_copy attributes table (as expected)
And I save "cities_copy" as cities.geojson
Then I see cities.geojson was exported with only the "important_stuff" attribute (as expected!)
When I inspect the attributes table for "cities" I still see "important_stuff" and "irrelevant_stuff" (as expected)

But when I close QGIS and reopen my project
When I inspect the attributes table for "cities"
Then the attribute "irrelevent_stuff" is missing, and I only see "important_stuff" (!!!)

I suspect what's happening is that the layers are sharing a single shapefile storage mechanism, and edits to one of the layers in QGIS do no propagate to the Layer in QGIS (until that layer is reloaded from file).

I'm not exactly sure what I would expect to happen. My immediate thought is that editing should be disabled for duplicate layers until they have their own backend.

If this is expected behavior (that edits in a duplicate layer affect the storage for another layer) than we should consider updating other layers that are backed by this file.

@qgib
Copy link
Contributor Author

qgib commented Nov 6, 2015

Author Name: Giovanni Manghi (@gioman)


"duplicate layer" do not duplicate (create a copy of) the datasource, it just duplicates in the project, the layer is the same.


  • resolution was changed from to invalid
  • status_id was changed from Open to Closed

@qgib qgib added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label May 25, 2019
@qgib qgib closed this as completed May 25, 2019
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!
Projects
None yet
Development

No branches or pull requests

1 participant