I imported a .shp file to QGIS with polygons from a non-topological database. Polygons were adjacent and shared borders, but most nodes didn't coincide. I then proceeded to fix all nodes and intersections manually (more than 3000) enabling snapping (with a 10 pixel tolerance) and topological editing. Sometimes topology worked and moving the node moved both borders, most of the time it did not. I finished correcting and checking all the nodes, topology checker indicates that there are no invalid geometries but a whole lot of gaps and intersections... except they DO NOT exist (I zoomed all the way to 50:1 and still can't see them). And all nodes seem to be corectly snapped to one another. Tried using v.clean in all possible ways but nothing happens because I suppose there is no cleaning needed. My guess is that since the shapefile is from a non-topological origin QGIS is not able to create topology for all the nodes even if they have been snapped together.

Does anyone have any idea how to fix this?

Or are there still elements missing from QGIS to achieve this?


Unfortunately the topology checker is not very robust in finding errors. (for german speakers there was a interesting comparison of topology checkers you have available with QGIS, Grass GIS and PostGIS at the latest FOSS-GIS conference this spring : https://media.ccc.de/v/2018-5330-geometrie-_und_topologiefehler_finden_und_korrigieren#t=1507)

There are two other ways you may try.

First is the v.clean tool you already mentioned. But did you set a snapping tolerance? You might have tiny coordinate deviations that are based on the shapefile and the way programs and tools handle coordinates. Try to set the snapping to some value that is in range of an acceptable accuracy. For example to 0.05 (5cm if you use a metric system).

The second option is to solve the shapefiles main problem of coordinate storage (in my opinion). Each coordinate might be saved in another accuracy depending on the number of digits where the numbers where rounded up or down. Therefore you can use the tool "Snap points to grid". You can set it to 0.001 for 1mm which is very accurate (way above the usual accuracy level of the data itself) but commonly used. Then a new file is created where the vertices of the polygons are snapped to the next grid-coordinate. It may solve many topology problems but creates a new file that is not "exactly" the same as the old one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.