I use QGIS 2.18.3 and I have a shapefile with around 30,000 lines and a lot of invalid geometries. It is imported from a CAD project. I managed to solve most of the invalidities with the break function of the v.clean tool from the GRASSGIS toolset.
The remaining errors, around 180, all have the same nature: they used to be closed lines in the CAD project (the outlines of stones) but are now open. So the two endpoints have exactly the same coordinates, therefore they overlap and the geometry is invalid.
Solutions I've tried:
Used the snap function of the v.clean tool - the tool runs without problems but there are still errors afterwards. I've put the threshold on 0.005 m. In advanced parameters I've put the v.in.ogr snap tolerance to 0.005 m as well and the v.in.ogr min area to 0.0
Used "lines to polygons" from the vector menu and converted the polygons back to lines again. All polygons were valid but when I convert them back to lines using "polygons to lines" the errors are still there.
Did I do something wrong or do you have any idea how to solve it in an automated way?