Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

  1. copy your data
  2. 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[1] = date
        date += delta
share|improve this answer

See the 'Accumulative and sequential calculations' section in the help file on Calculate Field examples. Convert your date value using the datetime module and use the datetime.timedelta object for the incrementing/adding of 6 seconds.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.