I have a table with a set of original XY values and a set of new XY values. I want to create new points of the new xy's using the insert cursor. My code updates the ID and Sp row but not the XY row.
for fc in arcpy.ListFeatureClasses('*Clip_1'):
X = 'X1'
Y = 'Y1'
ID ='Sp'
xy = []
with arcpy.da.SearchCursor(fc, [X, Y, ID]) as Cursor:
for row in Cursor:
xy = [(row[2],(row[0],row[1]))]
cursor = arcpy.da.InsertCursor(fc,['Sp','SHAPE@XY'])
for new in xy:
cursor.insertRow(new)
print str(new)
del row, xy
my output table looks like:
ID Sp X Y X1 Y1
1 21 25 25 21 19
2 22 12 29 12 18
3 23 14 18 22 10
4 21
5 22
6 23
What I want is
ID Sp X Y X1 Y1
1 21 25 25 21 19
2 22 12 29 12 18
3 23 14 18 22 10
4 21 21 19
5 22 12 18
6 23 22 10
Is there a better way to do this?
row
twice. – Vince Jul 9 '19 at 15:42