I want to compare each polygon from one shapefile with all the polygons from another shapefile.
When one polygon is geometrically identical to a polygon on the other shapefile, I want to copy the value of field "code" of the second shapefile to the field "code" of the first shapefile.
I wrote the following code:
fc1 = ur'D:\polygons1.shp' fc2 = ur'D:\polygons2.shp' fields = ['SHAPE@','code'] with arcpy.da.UpdateCursor(fc1,fields) as cur1: with arcpy.da.SearchCursor(fc2,fields) as cur2: for row1 in cur1: for row2 in cur2: row1 = row2 if(row1==row2) else '' cur1.updateRow(row1)
When I run the above code, the values from "code" are not copied plus there are no errors.