32

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 for Desktop - see Exporting feature class into multiple feature classes based on field values using ArcGIS for Desktop?

How do I do it using QGIS, GDAL, SAGA, etc?

44

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.

  • 1
    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 '17 at 9:24
5

Quantum GIS has a plugin called ShapefileSplitter, which does this.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

3

Use 'Split Vector Layer' in the Vector General Toolbox

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

1

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).

1

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
    is this different from the plugin suggested by @oeon? – matt wilkie Mar 12 '15 at 21:00
  • @mattwilkie its an algorithm that comes natively with QGIS. No need to install a Plug in for that! – Stophface Sep 26 '17 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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