Is there a way batch remove or delete null geometries from hundreds of small polygon vector files in QGIS, while saving the new clean file to their original directories? I can't check for and fix geometry errors individually but I'm happy to give up some precision / data integrity / knowledge for a method that saves time.
These shapefiles will ultimately need to be processed but any bulk batch processing I do throws up null geometry errors. Until I fix these there's very little I can do.
I'm wondering whether 'saving as' a different file type might remove the error? If so, is there a way of pointing each of the output files back to their original directories without having to do this for each one?
Best Answer
Removing null geometries from just a few layers
Removing null geometries from many layers
Open the Processing Toolbox and use the Vector Selection Tool, "Remove Null Geometries."
This tool has a batch processing mode. There's no option to automatically save the new file in the same location as the original. You will need to enter the file path for the new file.
Entering the file paths will be your slowest step. If you had less than 10-20 files, I would suggest copying each file path from the layer properties into a text file. Then you can quickly cut and paste from the text file to the batch processing window. If your hundreds of layers are in hundreds of different files, that won't be very efficient. At that point you may wish to pursue a python-based solution.