I am trying to find out if there is a way - or even an algorithm in QGIS - that enables you to effectively create a new feature layer that is a copy of an original layer but with only a selection of key fields that one might want to limit the layer to, for further analysis.
In other words, my original layer has, for example, 30 columns or fields but I want to make a copy of that layer that only has 6 of those fields retained within it. I am working with QGIS 3.14
-
Try Refactor fields. I usually write a small python script to enable/disable the fields since using the GUI takes require some work with many fieldsBera– Bera2020年11月19日 14:22:58 +00:00Commented Nov 19, 2020 at 14:22
-
Please, do not forget about "What should I do when someone answers my question?"Taras– Taras ♦2022年05月09日 11:01:38 +00:00Commented May 9, 2022 at 11:01
1 Answer 1
The export / save layer as dialog provides a list of fields where users can chose which fields should be included in the export.
To reproduce this in a Processing model, you can use the "Drop Field(s)" tool:
-
Thanks for this. Is there a way of incorporating this into a model within the graphical modeller tool of QGIS. I guess I can create the layers as I wish to have them prior to bringing them into the modeller but I hoped there might be a process I could use within the model itselfTrevP– TrevP2020年09月06日 13:44:01 +00:00Commented Sep 6, 2020 at 13:44
-
1@TrevP yes, the tool is called "Drop Field(s)"underdark– underdark2020年09月06日 13:52:17 +00:00Commented Sep 6, 2020 at 13:52
-
Perfect thanks. I may be looking at buying a copy of your book to bring me on a bit. I'm struggling with the syntax to use to get the fields to drop within the modeller but will keep working on itTrevP– TrevP2020年09月06日 14:16:35 +00:00Commented Sep 6, 2020 at 14:16
-
2@TrevP You're welcome. There's really no book though that can keep up with all the Processing tools. Therefore it mostly comes down to screening the related Processing tool boxes, checking the documentation, and asking questions where necessary.underdark– underdark2020年09月06日 15:03:42 +00:00Commented Sep 6, 2020 at 15:03
-
Thanks for that advice. I am a bit of a newbie at this level, beyond the front end stuff.TrevP– TrevP2020年09月06日 15:35:27 +00:00Commented Sep 6, 2020 at 15:35
Explore related questions
See similar questions with these tags.