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.

  • Capture the geometry as WKT so we can think how to fix it. The problem may come from the leftmost island. Some software accept such holes as loops in the outer ring while some other require that it is made with an inner ring. – user30184 May 24 '18 at 20:19
  • What are the shared points in the picture? Are you talking about the ring inside the polygon? – lynxlynxlynx May 24 '18 at 20:21
  • I had a similar issue with a shapefile that had holes and such invalid geometries. I got this solution as an answer: gis.stackexchange.com/questions/284100/…. Try it and see if it works for your case. – user3386170 May 25 '18 at 14:26
  • 1
    @user3386170 neither point on surface nor centroid were working. But the answer you linked worked, thanks! – fairground May 25 '18 at 15:55
  • I've added the solution as an official answer to your post (as a community wiki since I copied the answer from someone else). For your information (I see you are a new user), this forum asked that the poster accepts the answer as resolved to close the question. – user3386170 May 25 '18 at 18:16

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.

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.