-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Duplicate layer #15348
Comments
Author Name: Giuseppe Sucameli (@brushtyler) In the meantime, select the vector layer then open the QGis python console and run:
You can also create a little plugin using the previous snippet. |
Author Name: Giuseppe Sucameli (@brushtyler) Sorry, I've misunderstood the subject. The previous code adds to the map the +same+ sublayer. It's difficult to do it using a one-line python script like the previous one, but if you know the sublayer name you can just replace @vl.source()@ with @vl.source().split("|")[0] + "|layername=my_sublayer_name"@ where @my_sublayer_name@ is the name of your sublayer. |
Author Name: Bernd Vogelgesang (Bernd Vogelgesang) I already found several past feature requests which weren't processed or where the relevance of the topic didn't get clear enough. Use case: I have 13 groups of monitoring plots, where i have to produce overview maps of. For this, i need as basis a point, line and area layer which i then query for the group-id and put those layers in a group within the TOC for quick on/off of the features. Having the possibility to quickly duplicate the original set for performing queries and changing additional setting would be a real helper. Coding python scripts themselves is beyond average users abilities i fear... |
Author Name: Alister Hood (@AlisterH) Olivier redlead wrote:
Am I missing something here? I thought a shapefile could only contain a single layer... |
Author Name: Alister Hood (@AlisterH) Bernd Vogelgesang wrote:
Ah, OK. That's the use case. |
Author Name: Giovanni Manghi (@gioman) Alister Hood wrote:
I'm not sure that #11543 is about copy/paste layers between projects, seems really a duplicate of this ticket. By the way the one line code given by Giuseppe works like a charm (it works also for rasters with a trivial change) and I really would like to see a "clone layer" button (or "clone layer" right click dialog entry) dialog to be added to the standard toolbar. I already asked this privately to Giuseppe, let's see what he says.
|
Author Name: James Stott (@jamesstott) The duplicate layer button/option on the right click menu would be a great addition. A slight extension of this would be to enable you to add a layer for each value in a column of a dataset. For example, say I have a table with land uses (say 10 different types), and I want to create a separate layer with each land use in it. At the moment you would have to add the layer 10 number of times, and then do right click > query 10 times. A simple way to add a layer for each category in the land use type column would save a lot of time in this case. |
Author Name: Olivier redlead (@olivierdalang)
Original Redmine Issue: 5899
Assignee: Giuseppe Sucameli
Hi !
Often you want to display one Shapefile with several layers (example : for the shapefile LandUse.shp, show column "land_use_current" on one layer, and "land_use_projet" on another layer)
When you want to do so, you have to add the Shapefile several times, meaning you have to go in your file hierarchy to find it again each time you want a new layer from your data.
It would be really nice to have a little "duplicate layer" button !
Thanks !
The text was updated successfully, but these errors were encountered: