Select to view content in your preferred language

GP tool to export one feature at a time and log problem features in an error table

568
2
04-24-2024 01:26 PM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 2.9.5; Oracle 18c 10.7.1 EGDB; SDE.ST_GEOEMTRY:

I have an issue with an annotation FC:

  1. In 2.9.12, I get a "shape integrity error" when I open the attribute table and navigate to the last row. But I don't have that problem in 2.9.5.
  2. When I copy/paste the FC to an EGDB or FDGB via Catalog, I get a "shape integrity error".
  3. If I export using Feature Class to Feature Class, only 72 of 800 features get exported.
    1. Same problem with the Append tool in a blank annotation FC.
    2. If I exclude row 73 via a selection, then 357 rows of 799 get exported; still, not all features get exported.
    3. I haven't had any luck trying to exclude additional rows in the 355-360 range. Still, only ~355 rows get exported.
  4. The Repair Geometry tool doesn't support SDE.ST_GEOEMTRY.
  5. Esri Case #03605230 - What is CopyMultiple? (Catalog copy/paste shape integrity error)

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

2 Comments
MErikReedAugusta

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.

Bud
by

@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'

Bud_0-1714196544893.png