3

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

Taras
35.7k5 gold badges77 silver badges151 bronze badges
asked Sep 6, 2020 at 13:30
2
  • 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 fields Commented Nov 19, 2020 at 14:22
  • Please, do not forget about "What should I do when someone answers my question?" Commented May 9, 2022 at 11:01

1 Answer 1

8

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:

enter image description here

Taras
35.7k5 gold badges77 silver badges151 bronze badges
answered Sep 6, 2020 at 13:34
5
  • 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 itself Commented Sep 6, 2020 at 13:44
  • 1
    @TrevP yes, the tool is called "Drop Field(s)" Commented 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 it Commented 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. Commented 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. Commented Sep 6, 2020 at 15:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.