I am trying to write some python code to calculate a change in Z value from one point to the next. I have a number of point files with Z values in a field called "RASTERVALU". I have a field called zdiff that I would like to update with " Zdiff(row1)=Z(row2)-Z(row1)". I can use the update cursor it to look at the backwards change (Zdiff(row1)=z(row1)-Z(row0)) but not the forward change (Zdiff(row1)=z(row1)-Z(row0)).
I used the following code below but it seems like the updaterow.next() is messing up my sequential flow through the rows. Let me know if anyone has any ideas:
for row in updateRows:
The first run through the loop works ok but then it iterates to the third row instead of the second row. I assume it is because of my use of updateRows.next() but I am not sure. I can’t find very good documentation of the updateRow.next or any of the cursor information.