[GIS] Unable to perform centroids or point on surface operations because of “invalid geometry”

censusqgis

I am dealing with census blocks, and some of them have strange shapes, where they share a single point with two other census blocks. enter image description Some census blocks have other blocks inside them, though they share one boundary vertex. Although check validity returned no issues, I am not able to create centroids with the census block features because of this geometry, because these operations return the "invalid geometry" error for those features. Note that the four small features that are (mostly) surrounded by the selected feature all have centroids, but the selected feature does not. The problematic point seems to be the one on the bottom left shared by the tear-drop shaped block, the long rectangle-shaped block, and the selected block.

Here is a link to the wkt for reference.

I have tried simplifying geometry, which returns the same "invalid geometry" error. I also tried v.clean.break with GRASS, but I am not able to create centroids with that output, and the view-only output produced by GRASS displayed "Inconsistent values of FID and field of same name" as an error when I attempted to save the output feature class. I'm very stumped. I probably should ignore this, but such geometry is not uncommon in US city boundaries, so I would like to make sure that I can create centroids with in QGIS.

Best Answer

I had a similar issue with being unable to perform an operation due to invalid geometries. @ndawson resolved it by suggesting the following this post: How to ignore invalid geometries in performing spatial join in QGIS 3.0?

Essentially, invalid geometries can be ignored by changing settings:

From Settings -> Options -> Processing tab, expand out the General setting.

Look for "Invalid features filtering" and set it to "Do not filter"

For screenshot of options return to original post.

Related Question