TransWikia.com

Fixing polygon self-intersection in QGIS?

Geographic Information Systems Asked by apetbrown on October 4, 2021

I am attempting to mask a raster to US Forest Service boundaries in QGIS. It fails due to self – intersections of polygons.

Warning 1: Ring Self-intersection at or near point -109.90112962000001 43.649977879999994
ERROR 1: Cutline polygon is invalid.

I have run the check validity tool and a new shapefile is created but it too finds the same error when attempting to mask the raster to the “valid” shapefile.

I have also attempted to dive into the v.clean tool with unsuccessful results using both bpol and snap separately. I don’t fully understand what this tool is doing, but it outputs a number of polygons that match some Forest Service land but excludes the majority of their land.

I also ran v.build.check to find topological errors and it created an output that is seemingly empty. Nothing in the attribute table, nothing visible on the map.

There have been similar questions on here but I haven’t been able to make their solutions work.

I downloaded and used GRASS to attempt to fix the self-intersecting polygons. GRASS upon v.in.ogr recommended I snap at 1e-6. I did this and the output said I had 1 area overlapping left when previously I had thousands. So I saved the shapefile and imported to QGIS to being my analysis over there. The check validity tool found 185 self-intersecting polygons.

example1

Still unable to use the clipper to create a Mask, I decided to look at the error output on the Map. The snapping tool isn’t fixing these nodes.

example2

Here’s a larger picture of the area.

example3

I wonder if it would be easiest just to dissolve these shapes in some way.

4 Answers

When I get errors like this I usually find applying a zero distance buffer can fix the geometries. So use the buffer tool in QGIS and set the buffer distance to 0 units. Then try and use this buffered layer as the mask.

Answered by Liam G on October 4, 2021

I managed to clip a vectorized raster just like the one in your picture after doing a "multipart to single part" and it didn't skip any polygon, though it keeps displaying the polygons with the overlapping vertices.

Answered by Elio Diaz on October 4, 2021

Further to the above answer of 0 buffer distance - this didn't work for me, HOWEVER I will give credit to the author for leading me down the right path. I actually ended up applying a 1mm buffer and dissolving the result. I would recommend dissolving as a secondary step, because you may wish to apply different dissolve parameters (as opposed to using the 'Dissolve' option inside of the Buffer tool).

This fixed the self-intersection issues I was experiencing. The resultant area increase was negligible. This number may need to be adjusted based on need and tolerances, but 1mm (millimeter) increase for non-real world objects was an acceptable distance.

Answered by nr_aus on October 4, 2021

I managed to fix a similar issue by clicking on Toggle Editing and then using the Node tool to highlight all the vector nodes and then manually adjust the location where the ring self-intersection point was found.

Answered by Clementine on October 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP