Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a polyline shape files with about 20 kinds of roads. I would like to know how can I create automatically a vector file for each one.

I can use Arcgis, Qgis (or Gdal separately).


share|improve this question
I posted an answer similar to your question before about this, see gis.stackexchange.com/questions/9998/… –  artwork21 May 18 '12 at 17:10
add comment

5 Answers

you can use Export Feature Attribute to ASCII (Spatial Statistics) with arcpy. get some information here...


ExportXYv_stats (Input_Feature_Class, Value_Field, Delimiter, Output_ASCII_File, Add_Field_Names_to_Output)


Example Code:

import arcpy
arcpy.env.workspace = r"c:\data"

i hope it helps you...

share|improve this answer
Thanks for the explanation, but ascii is a raster format. I want to get a shape file ( or any other vector format ) to work separately on them ) I found out that it's is possible with Qgis, it's actually in the basic menu ( -_- ) thanks anyway the Function is SEPARATE A VECTOR LAYER in the vector menu ( then you choose the ID and the directory ) –  Bobo May 18 '12 at 9:10
ASCII isn't a raster format. ASCII just means ASCII text format en.wikipedia.org/wiki/ASCII –  Nathan W May 18 '12 at 11:11
Bobo, since you found a solution you should write it as an answer and accept it. That way future readers with the same question can easily find the answer. –  user3461 May 18 '12 at 11:14
nevermind Aragorn I was confuse, thanks anyway –  Bobo May 18 '12 at 12:55
add comment

Quantum GIS has a plugin called ShapefileSplitter http://plugins.qgis.org/plugins/shapefile_splitter/version/0.1.2/ which does this.

share|improve this answer
I can't seem to find a download link for this anywhere. I looked within "Fetch python plugins" within qgis, and did not find it either. –  Mike May 24 '13 at 14:08
I think QGIS plugin reorganization lost us for a bit. It appears it's still available for QGIS 1.8 here: plugins.qgis.org/plugins/plugins.xml?qgis=1.8 - Direct link: plugins.qgis.org/plugins/shapefile_splitter/version/0.1.2 –  oeon Sep 10 '13 at 17:21
add comment

Create a search cursor, loop through each row. At each row, take the OID (or any other unique value) and put it in a where clause. Use that where clause in the Select_analysis(in_feature, out_feature, whereClause) gp tool.

If you want to go by type of road rather than a new fc /shapefile for each row, you'd use the select method on the first record, then append all other records of that road type to that fc / shapefile with an if/else structure.

share|improve this answer
add comment

You can use this toolset for ArcMap 10 as well.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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