I have created a date field in my point shapefile. I want to input date their. I am able to do so. Now I want to create a sequential increment with 6 second interval from previous point to next point. I have Google it but didn't find any solution. Please help me how can I do it with a huge data set.
Below is code that'll do this at 10.1. You're going to have to figure out which field you want to sort by (i'm using shape_area).
If you wanted to do this with the old cursor (arcpy.UpdateCursor vs arcpy.da.UpdateCursor) the code would be slightly different.
- copy your data
- modify code below to work with copy of your data
import arcpy import datetime tab = r'e:\test\f.gdb\fc1' # table being acted on date = datetime.datetime(2004, 1, 1, 0, 0, 0) # start date delta = datetime.timedelta(seconds=6) # time offset with arcpy.da.UpdateCursor(tab, field_names = ('shape_area', 'datefield',), sql_clause = ('','ORDER BY shape_area')) as cur: for row in cur: row = date date += delta cur.updateRow(row)