I'm trying to calculate an angle between points using a field calculator. Is it possible to reference the previous or next FID with reference to the current one using the field calc?
Eventually I'd like to have an angle between the next and previous point be input into a field for the current point - like shown below
Answer
Yes, you can access previous values with Field Calculator. I'd suggest migrating to Python and using update cursors, where it would be a lot simpler to work with values forward (via reading into a list) or reverse.
Code Block:
prev=None
def diff(curr):
global prev
if prev is None:
prev = curr
res = curr - prev
prev = curr
return res
Expression: diff(!test!)
No comments:
Post a Comment