Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #need to update FERRY column with yes or no values if ferry crossing is available in feature field
- delimfield = arcpy.AddFieldDelimiters(fc, "FERRY")
- cursor = arcpy.da.UpdateCursor(fc, ["FERRY"])
- for row in cursor:
- if row[0] == "ferry crossing":
- cursor.updateRow("FERRY")
- print "YES"
- if row[0] is not "ferry crossing":
- cursor.updateRow("FERRY")
- print "NO"
- del row
- del cursor
- #if feature is ferry crossing == YES in FERRY field
- #if feature is not ferry crossing == NO in FERRY field
- with arcpy.da.UpdateCursor(fc, ["FEATURE", "FERRY"]) as cursor:
- for row in cursor:
- if row[0] == "ferry crossing": # test the FEATURE field
- row[1] = "FERRY" # set the FERRY field
- print "YES"
- else:
- print "NO"
- cursor.updateRow(row) # commit the changes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement