Thursday, 5 July 2018

Turning vector grid into individual shapefiles using QGIS?


I am using QGIS and I created a vector grid on a crop field in order to cut it into plots. I want to save each grid cell into individual polygon shapefiles automatically.


Here is an example of a vector grid I would like to split into 117 shapefiles:


Example of a grid I would like to split into 117 shapefiles



Eventually, I did it manually with the selection tool and "Save as" but it is really time-consuming when there are more than 100 plots to save.


Is there any way to do it faster and more automatically?


Each plot as an attribute named "Plot" that can discriminate against them (basically being id + 1). It's the attribute used here to label them.



Answer



You need to use Split Vector Layer from processing toolbox. You can find the tool from Processing toolbox -> QGIS geoalgorithms -> Vector general tools -> Split Vector Layer


Select the input shapefile and use a unique ID field to save each grid block into separate file. You need to specify the output folder to save all the polygons in it.


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...