I have a very large shapefile (all the roads in RI). I need to split it up into chunks so that I can process the file with multiple worker threads in Python. So far I have created a grid in QGIS that is overlaid on the vector data. I then ran the intersection algorithm with the grid and the shapefile so that the vectors are split up and are assigned an 'id'
for the box they're part of.
Now, since all the vectors in a particular box of the grid all have the same 'id'
, can I extract them and save them to their own shapefile automatically? I am aware of selecting all vectors with an 'id'
and then copying them to their own layer and then saving that layer, but I have so many boxes/id's that it would take forever to save each of them off. How can I use QGIS to automatically make a new shapefile for each id/box?
Basically I want create a new shapefile for each distinct value of a particular field in the shapefile attributes.
Original Shapefile
Shapefile after grid intersection
A set of vectors which share the same bbox/id