How to identify polygons with "flag" sliver errors

if you have access to Safe Fme tools you will find useful the transformer called spikeRemover, give it a look. You may try a downloadable limited version of SAFE FME or check your ArcGis license for "FME Extension for ArcGIS"

http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/spikeremover.htm

http://cdn.safe.com/resources/fme/FME-Transformer-Reference-Guide.pdf


With arcmap 9.3.1, I would add a field called Flag (or maybe FlagFlag?) and use VBA code in the field calculator to calculate this field.

The VBA code would dim a variable as ITopologicalOperator3 and set it to the Shape field.

It would then call the not-so-simple IsSimpleEx method.

Set the Flag field value to the esriNonSimpleEnum. Presumably the error you are concerned with would return esriNonSimpleSelfIntersections.

With 10.0 there may be a way to do this with python in the calculator (?) ... I'm not sure. I would use an add-in command. IMO Esri should provide support for c# in the field calculator. After all, the c# compiler is installed as part of the .NET framework.

Update

The code I posted here might find flag poles if you apply a Definition expression "Left_OID" = "Right_OID" to the resulting polyline featurelayer.


I'm not sure where your problem occurs, or where you have the possibility to avoid/fix it. But I've seen this a lot in our SDE-database although geometries in SDE should always be correct. In our case it was because we imported shapefiles using ArcObjects into the SDE. When the geometries was stored they snapped to the grid of the SDE and thus created incorrect geometries with the slivers you describe when the geometry had a thin spike. This because shapefiles have full double precision for the coordinates and the SDE a coarser grid.

Our solution was to fix the geometries when they were imported by:
1. Set the spatial reference of the geometry from the shapefile to the spatial reference of the corresponding SDE feature class
2. Snap the geometry to the spatial reference (IGeometry.SnapToSpatialReference())
3. Set ITopologicalOperator2.IsKnownSimple=false (important, otherwise simplify doesn't do anything)
4. Perform some simplify operation. For polygons we used IPolygon.SimplifyPreserveFromTo()