2

One of my tools was having problems, during debug I encountered a new error based on FDO error codes:

Case -2147220982
    fKnownErrNum = "The object has been deleted and is no longer valid."

Attempting to edit the feature class in ArcMap: enter image description here

Which suggests that the data editor (somehow) has inserted a geometry that isn't the expected PolyLineZ into the table.

I tried to remove the bad shape with a tool I wrote but on the line pFeature = pFeatCur.NextFeature I get this error message:

enter image description here

Theoretically it should be impossible to insert a row with an incorrect geometry into an Esri file geodatabase, which has me scratching my head and wondering, but academics aside the data represents capture time and I would like to salvage if possible what I can. So far I have tried Repair Geometry, my own tools (with obvious failure) and the usually reliable Export to XML workspace document - which returns a similar error to editing in ArcMap.

Has anyone experienced a similar issue to this and been able to redeem (even partially) the data?

  • In Python i'd use try except pair going with search cursor and build a tuple of failed oids. Open table select oid in tuple, delete features – FelixIP May 24 '16 at 6:07
  • That's a good idea @FelixIP, I'll give that a shot. I was thinking something like build a list of OIDs then attempt a make feature layer with a query by each OID with a try/except and export each; the problem with this is the only way I can think of to enumerate the OIDs is via a search cursor which fails with a similar error on for row in cursor: Can you think of another way to enumerate the OIDs without a cursor? – Michael Stimson May 24 '16 at 22:00
1

Try this on a new numeric field

def isWrong(shp):
 try:  b=shp.firstPoint.X;  return 0
 except: return 1

-------------------------

isWrong( !Shape!)

and select records with 1. Note you can delete features using tool outside editing session.

If the outcome are 0s only, I afraid there something else, not a bad shape.

  • I'm afraid that didn't work, the DB is corrupt (I'm getting values that contain non-printing characters) any attempt to write to the table fails with same or similar errors (editing is worse than non-editing, the table is blank with 'unable to load data' error). This is why we keep backups; only a few hours were lost as the other tables/feature classes are accessible. It seems this error message is the tolling of the bell for this database. – Michael Stimson May 25 '16 at 22:56
  • That was my feel – FelixIP May 25 '16 at 23:27
  • Nice try anyway, it didn't help in this case but might work in a slightly different case for someone... I'll call this one accepted as it lead me to the realization there was no hope for the data. – Michael Stimson May 25 '16 at 23:44

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.