42

I have a polyline shapefile with about 20 kinds of roads.

I would like to know how can I create automatically a vector file for each one.

I am aware of how to do it using ArcGIS Desktop - see Exporting feature class into multiple feature classes based on field values using ArcGIS Desktop?

How do I do it using QGIS or SAGA?

1
  • Please reopen this. This post/question has already been edited and now focused. Oct 2, 2020 at 2:21

5 Answers 5

57

In QGIS 2.8.1 there's a tool in the Vector menu that can split a dataset based on an attribute.

Look in Vector > Data Management Tools > Split Vector Layer...

split vector layer tool in QGIS 2.8.1

It's a basic tool that should work if you don't want to resort to plugins or tools in Processing; unless they offer additional functionality you need.

3
  • 2
    Unlike the other vector tools this one does not add the files to the project, and you should select an output folder with Browse to find them afterwards.
    – AndreJ
    Oct 29, 2017 at 9:24
  • 2
    Is there a way to specify .shp as the output file type? It seems that .gpkg is the only option.
    – alaybourn
    Feb 21, 2020 at 20:51
  • 3
    @alaybourn I think if you go into Options/Settings, then into Processing, there is a setting in there to change the default output from gpkg to shp.
    – SaultDon
    Feb 21, 2020 at 20:53
6

Plugin won't work on QGIS 3 and higher

QGIS has a plugin called ShapefileSplitter, which does this.

0
4

Use 'Split Vector Layer' in the Vector General Toolbox

This tool will allow you to split a vector layer based on an attribute column. It splits the data into separate shapefiles for each unique attribute in the column.

0

You could consider saga gis (either directly or through sextante in qgis). It contains a module that will split a shape by attribute (shapes/tools/ split table/shape by attribute).

0

On the processing toolbox of QGIS, if you go the example scripts of the Scripts section. You'll find the script called "Split vector layer by attribute". That'll do what you need.

2
  • 2
    is this different from the plugin suggested by @oeon? Mar 12, 2015 at 21:00
  • @mattwilkie its an algorithm that comes natively with QGIS. No need to install a Plug in for that!
    – Stophface
    Sep 26, 2017 at 15:04

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