2

I have a layer (GeoJSON) with multiple features. I want to split the layer up into multiple shapefiles using QGIS.

I don't want a file for each individual feature. Is it possible in QGIS to select features and cut and paste them to a new file?

5
  • 1
    Select features, then right click the layer and choose to export only the selection.
    – Erik
    Aug 19, 2020 at 9:15
  • @Erik How do I select a feature? I am new to QGIS.
    – Stephen
    Aug 19, 2020 at 9:17
  • 3
    Please have a look at the QGIS documentation and tutorial, basics are covered there.
    – Erik
    Aug 19, 2020 at 9:19
  • 1
    If you can give us more specifics we could help you further. Do you want to select based on an expression? What kind of dateset are we dealing with here?
    – MarcM
    Aug 19, 2020 at 9:26
  • 2
    Which shapefile do you want to split? You start by saying you have a GeoJSON file, where does the shapefile come from?
    – nmtoken
    Aug 19, 2020 at 16:48

1 Answer 1

5

It was not clear to me how the features have to be split and saved, e.g. only selected or simply all. Hereupon I am providing several possibilities that may answer the question.

Case 1. When certain features have to be selected and exported afterwards

Check the following articles:

Exactly what @Erik mentioned in his comments.

Case 2. When all features have to be exported

Let's assume there is a polygon layer called 'grid' with its corresponding Attribute Table, see the image below.

input

In the attribute table, there is a unique attribute, for example "ID", otherwise create it using @row_number in the Field Calculator.

Proceed with "Split vector layer" can be found in Vector > Data Management Tools > Split Vector Layer... using the "ID" as 'a Unique ID Field'.

And get the output

output

Note: Mind that every single output will be temporal and in .gpkg-format.

Case 3. When all features have to be exported but they possess an attribute in common.

It can be done the same way as was done on Step 2. Nevertheless, there is an additional way described in this thread: Dividing shapefile into multiple shapefiles using an attribute value in QGIS Graphical Modeler

1
  • I'd have suggest this solution, too, if OP hadn't stated they didn't want/need a single file for each feature.
    – Erik
    Aug 19, 2020 at 10:04

Your Answer

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

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