I have a small list of points, testingPoints, that need their geometry (x and y points) transferred to points within a larger dataset, baseCentroids. The datasets share a common field POINTID to help identify one for the other. This is the code I have:
rowFields = ['POINTID','SHAPE@X', 'SHAPE@Y']
rows = arcpy.SearchCursor(testingPoints, rowFields)
for row in rows:
whereClause1 = "POINTID = '" + row.getValue('POINTID') +"'"
pointFields = ['POINTID','SHAPE@X', 'SHAPE@Y']
points = arcpy.UpdateCursor(baseCentroids, whereClause1, pointFields)
for point in points:
point.setValue("SHAPE@X", row.getValue(SHAPE@X))
point.setValue("SHAPE@Y", row.getValue(SHAPE@Y))
#tried this method as well
#point[1]=row[1]
#point[2]=row[2]
rows.updateRow(row)
While to me this looks correct it is not.
PointGeometry
objects - withShape@
)arcpy.da
cursors and use a dictionary to avoid nesting them?