ArcGIS Pro 2.9.5; Oracle 18c 10.7.1 EGDB; SDE.ST_GEOEMTRY:
I have an issue with an annotation FC:
It seems like some rows are broken and preventing GP tools from working properly.
I think it would help to have a GP tool that would export the features one-by-one to a FC. If the tool comes across an error, it could log the issue for each feature in a separate error table, and then move on to the next feature. That would be more useful than the behaviour in other GP tools that produce a generic error (no indication of what rows are the problem) or only exporting a subset of the rows.
I don't have the skills to do this in Python.
I got the idea from this Oracle PL/SQL function: Find problem XML values by catching XMLTABLE() errors in custom function
Short-term workaround:
I don't work much with Annotation FCs, but could you run a SearchCursor to read it from the existing (broken) table, and an InsertCursor to write it one record at a time to a new table?
You could use a try/except block to skip the broken rows & print a message about them.
@MErikReedAugusta Thanks for the Python suggestion. I'm much better with SQL than with Python, so I ended up writing a PL/SQL function to flag problem rows in a SQL query.
I wrote a custom function that uses ST_INTERSECTS() to check if each feature can be used in a spatial SQL operation. If there is an error, then the function returns "error" to the query's resultset. That let me flag the problem row.
Stack Overflow: Find row with problem shape (SDE.ST_GEOMETRY spatial type)
with function check_shape(anno_shape sde.st_geometry, boundary_shape sde.st_geometry) return varchar2 is v_test_result varchar2(10); begin select sde.st_intersects (boundary_shape, anno_shape) into v_test_result from dual; return 'no error'; exception when others then return 'error'; end; select anno.objectid, anno.shape as anno_shape, check_shape(anno.shape, boundary.shape) as check_shape from city.boundary boundary cross join infrastr.gcsm_hc_anno anno where check_shape(anno.shape, boundary.shape) = 'error'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.