How do I compare the SHAPE field between two Annotation feature classes?

332
1
09-12-2011 11:55 AM
TannerSemerad
New Contributor II
I am writing a custom replication script that compares each field of every row in a feature class. I am able to compare the SHAPE field in point, polyline, or polygon features using row.SHAPE.equals(other_geometry), but this won't work for annotation feature classes. The returned arcpy object for the SHAPE field in annotation feature classes is a 'passthrough' object rather than a Polygon object. It doesn't seem to have any useful attributes for comparing. Is there any way for me to determine if the SHAPE fields are different between two annotation feature class rows?
Tags (2)
0 Kudos
1 Reply
JakeSkinner
Esri Esteemed Contributor
I was able to compare two annotation feature classes using the Shape fields.  Below is an example of the code I used:

fc = "AirportsAnno"
fc2 = "AirportsAnno_1"

y = str(arcpy.GetCount_management(fc))

x = 1

while x <= int(y):
    rows = arcpy.SearchCursor(fc, "OBJECTID = " + str(x))
    rows2 = arcpy.SearchCursor(fc2, "OBJECTID = " + str(x))
    for row in rows:
        geom = row.shape
    for row2 in rows2:
        geom2 = row2.shape
    if geom.equals(geom2):
        print "OBJECTID " + str(row.OBJECTID) + " matches"
    else:
        print "OBJECTID " + str(row.OBJECTID) + " does not match"
        
    x += 1

del row, rows, row2, rows2


I tested this on the annotation feature class when a feature's text was updated, and when the annotation was moved.  In both cases the script reported that the features do not match.
0 Kudos