I'm trying to use ArcPy to copy only the geometry from one feature class to another based on a certain condition. Here is my code so far:
source_fields = ['contition_field', 'SHAPE@'] icursor = arcpy.da.InsertCursor(target_fc, 'SHAPE@') with arcpy.da.SearchCursor(source_fc, source_fields) as scursor: for row in scursor: if row == 'condition1': icursor.insertRow(row)
When I try to run it, I get this:
TypeError Traceback (most recent call last) <ipython-input-14-bc6790d82eb2> in <module> 6 for row in scursor: 7 if row == 'condition1': ----> 8 icursor.insertRow(row) 9 10 TypeError: cannot read geometry sequence. expected list of floats
I tried doing a few searches on this error, but it seems like most people don't have a problem with copying geometry, they have problem with copying other fields. However nothing seems to allow me to copy the feature geometry (like in this thread):
What is wrong?