I'm trying to update missing values in one .shp from another .shp. I'm using SelectLayerByLocation to identify the properties which lie within the boundaries of a suburb and then using a UpdateCursor to update the properties list with the suburbs. The code below doesn't iterate through the list correctly so all I get is the first value from the initial SearchCursor updating the properties list.
fc_P = propertyDataset
fc_S = suburbsDataset
LOCALITYList = []
query = '"LOCALITY" =\'\''
field_P = ["LOCALITY"]
field_S = ["ADMINAREA"]
arcpy.MakeFeatureLayer_management(fc_S,"Suburbs_layer")
arcpy.MakeFeatureLayer_management(fc_P,"Properties_layer", query)
arcpy.SelectLayerByLocation_management("Properties_Layer", "WITHIN",
"Suburbs_Layer")
with arcpy.da.SearchCursor("Suburbs_layer",field_S) as Srow:
for row in Srow:
Suburb = Srow[0]
with arcpy.da.UpdateCursor("Properties_layer", field_P) as Ucursor:
for Urow in Ucursor:
Urow[0] = Suburb
Ucursor.updateRow(Urow)
del Ucursor
del Srow
for locality in localitylist:
)