I have a shp file in qgis. I would like to export that shp file into geojson. I have seen the save as option. But, my point is to create individual files for each individual shape in the gis project. Is that possible?
Asked
Active
Viewed 3,239 times
7
-
1I don't think it is duplicate of this question. I think that OP wants to generate seperate layer with each one feature of existing layer. Not splitting by other layer. – Oto Kaláb Feb 17 '17 at 10:43
1 Answers
8
Use Save seleted features from processing toolbox. Select layer and check iterate button, which runs algorithm (in our case - save) separately on each feature. When choosing output file, select Files of type GeoJSON. By default, output layers will be numbered.

Oto Kaláb
- 6,895
- 3
- 29
- 50
-
1You can find it in menu Processing --> Toolbox (or
CTRL + ALT + T), or like activating other panel/toolbar rightclick somwhere on panel/toolbar and check what you want to appear. If you don't see Processing in the menu, probably its deactivated in plugin manager (Plugins --> Manage and Install Plugins...) – Oto Kaláb Feb 17 '17 at 14:17 -
Thank you! It's really helpful. One last thing: can we change the way of output naming? E.g. a value from table of attributes. – Gamze Feb 17 '17 at 14:22
-
I thought about this :) I don't have experiences with this, but I think it is interesting task, so if its not anwsered before, don't hesitate start new question about this. I wrote a small python script some time ago, but its handling only names in Layer panel after iterations not the files. So maybe some experienced have already solution on this task. – Oto Kaláb Feb 17 '17 at 15:10
-
I tried this method, and it gave this error message, "There are no selected features in the input layer." Fortunately there is another method that worked for me. https://gis.stackexchange.com/questions/25709/splitting-shapefile-into-separate-files-for-each-feature-using-qgis-gdal-saga – csk Jan 22 '18 at 22:12
-
You can also use 'split vector Layer' in the vector toolbar (native:splitvectorlayer), if you want to specify a layer name using a dynamic value. – GeoGyro Dec 09 '22 at 17:38