Select to view content in your preferred language

Add topology rule exception via python

1193
0
01-15-2013 06:14 AM
AveryPenniston
Occasional Contributor
I have a python script that adds a topology to a feature dataset (in FGDB), adds a feature class to the topology, then adds a gap rule and an overlap rule.  The script then validates the topology and exports the topology errors to feature classes.  I then export the resulting topology error feature classes to CSV files, using the ExpoertXYv_stats function, for use in later process.  I then delete the topology error feature classes exported from the validate topology step, and the topology itself.

The problem is that some of the polygons that are participating in the topology aren't completely bounded by other features, and as a result, are showing up as gap errors.  I understand that technically these are being correctly identified as gap errors.  However, I want to ignore these particular errors as they are acceptable.  Hence, I want to add an exception to the gap topology rule so they will not show up in my output files. 

Is this possible to do in arcpy?  I have not seen any arcpy functions to do this, unless I am missing something.


If its not possible to add a topology exception in python...

Is there some way to identify the particular validation errors in the output so I can skip them in post processing? 

From what I can tell there are only the following attribute fields available in the output:
X,Y,OID,OriginObjectClassName,OriginObjectID,DestinationObjectClassName,DestinationObjectID,RuleType,RuleDescription,isException

The coordinates in my CSV file looked like it might be the centroid, so I thought I might be able to use that to identify those particular gap errors.  However when using the 'Feature to Point' toolbox tool to find the centroid of the polygons and verify this, it appears the ExportXYv_stats function coordinates is not the centroid.

Any other ideas?
Tags (2)
0 Replies