I have a script where I select point features within a mile of major roads. If the feature falls within a mile of a major road then the field
within_mile_road is updated with
yes. If not, it remains null. I want to update the
within_mile_road from the feature layers that I create back to the original feature class. How do I update the values that were written to the feature layer back to the feature class, here is my code below which does everything except update the original feature class.
import arcpy arcpy.env.workspace = 'workspace' roads = 'roadsfc' fields = ['within_mile_road'] for fc in arcpy.ListFeatureClasses(): arcpy.MakeFeatureLayer_management(fc, fc+"_lyr") arcpy.SelectLayerByLocation_management(fc+"_lyr", "WITHIN_A_DISTANCE", roads, search_distance="1 Miles") with arcpy.da.UpdateCursor(fc+"_lyr", fields) as cursor: for rowFL in cursor: rowFL == 'yes' cursor.updateRow(rowFL)