I am cleaning up a curbed streets feature class. The fc was appended to as sections were completed. I modified the remove duplicate appends script. It ran successfully without error. The script is….
import arcpy
fc = r"N:\laura\edit_map4\edit_map4.gdb\StormCurbedStr_ExportFeature2"
feilds = ["FULLNAME","curb","SHAPE"]
keepList = list()
with arcpy.da.UpdateCursor(fc, feilds) as cursor:
for row in cursor:
row_val = row[0] + row[1] + str(row[2])
if row_val not in keepList:
keepList.append(row_val)
elif row_val in keepList:
cursor.deleteRow()
else:
pass
print("done")
The results are being looked over to verify it functioned as expected. Several features were deleted, as expected. The find identical tool was run on the resulting features to verify further. The same three fields were used as parameters and were in the exact order as in the original remove duplicate appends script. Also, the output duplicates-only box was checked. The find identical tool found 66 duplicates in pairs. I am investigating why the script did not find these. After checking both the FULLNAME and curb fields, they were identical in each of the 33 pairs. I.e., no leading or trailing spaces, misspellings, or even discrepant capitalization. I ruled these 2
fields out. The select-by-location tool was used to check the geometry. Both the input feature and the selecting features were the curbed streets feature class, and the relationship was are identical to. All 66 features returned. To see how the script dealt with the shape parameter, I ran a script to see what it used for the shape parameter values. The script is…
fc = r"N:\laura\edit_map4\edit_map4.gdb\StormCurbedStr_invegstate_3"
feilds = ["FULLNAME","curb","SHAPE"]
with arcpy.da.UpdateCursor(fc, feilds) as cursor:
for row in cursor:
print(str(row[2]))
It returned some weird results. First, it gave me a list of coordinate points even though it is a line feature. I copied the output and pasted it into Excel to highlight the duplicates. No duplicates were flagged. It seems like the script pulled different points along these lines in each instance.
It boils down to 3 things.
Why is the script returning coordinates when it is a line feature?
How/what is the update cursor object using to satisfy the shape field?
How do I amend the remove duplicate appends script to get all the duplicates?