3

QGIS 3.4.2-Madeira running simplify on a polygon z shapefile with 1075 rows. "Feature (99) has invalid geometry" not sure how to find this feature. If I edit and delete the row with OBJECTID = 99 and rerun simplify the same error presents but lists Feature(98) as invalid.

Interestingly running Geometry Tools\ Check Validity returns no errors and no invalid output, but if I run the fix geometries tool and then run simplify on the Fixed geometries layer then simplify works fine.

Key question I have is how to identify (and fix) the problem geometry for "Feature 99". Does the 99 refer to the OBJECTID?

2
  • 1
    It refers to the feature id. Your objectid can be something different. But you could also set your processing tools to ignore invalid inputs.
    – MrXsquared
    Commented Dec 8, 2020 at 22:46
  • 1
    Thanks MrX. I now understand that the Feature ID is only available if it is explicitly added to the Attribute table. My question and the solution appear to be identical to gis.stackexchange.com/questions/336702/…. By adding a new column with $id I was able to identify which row related to feature id 99.
    – Philip B
    Commented Dec 8, 2020 at 23:53

1 Answer 1

3

Feature (99) refers to the feature id with the number 99. In PyQGIS this would be identical to feature.id() == 99 and in fieldcalculator identical to $id = 99.

Your OBJECTID is just a field. It can contain anything. We dont know what that actually is.

To find your Feature (99) create a new field with the expression $id.


An alternative would be to set your processing tools to ignore invalid inputs. Go to "Settings" --> "Options" --> "Processing" and change "Invalid features filtering" to "Skip (ignore) features with invalid geometries":

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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