Hi there,
I am looking to find out which protected areas (output_PA_clip) fall into a planning unit (spatialjoin_fc), using the Select Layer by Location tool. If they meet this criteria, I would like them populate a field ("lock_out") to be "TRUE" (this is for a Marxan type model)
Running this through arcpy creates individual "layers" (although not saved to the gdb) for each PU that meets this criteria. With run times of over 4 hours and the creation of 2000 + layers
Is there a way to "select" the feature based on my specific query but not have them create new layers each time?
Code below:
values = [row[0] for row in arcpy.da.SearchCursor(spatialjoin_fc, "lock_out")]
with arcpy.da.InsertCursor(spatialjoin_fc, "lock_out") as cursor:
for row in values:
arcpy.SelectLayerByLocation_management(spatialjoin_fc, "have_their_center_in", output_PA_clip )
row[0] == 'TRUE'
cursor.insertRow(row)
del cursorThanks for your help!