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?

Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389
Philip B
  • 61
  • 1
  • 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 Dec 08 '20 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 https://gis.stackexchange.com/questions/336702/adding-id-values-in-attribute-table-after-digitization. By adding a new column with $id I was able to identify which row related to feature id 99. – Philip B Dec 08 '20 at 23:53

1 Answers1

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

MrXsquared
  • 34,292
  • 21
  • 67
  • 117