3

I'm trying to calculate the distance between the centroids of adjacent records (adjacent in the attribute table, not necessarily in space) into an attribute field. I'm planning on using the truecentroid.x and truecentroid.y properties of one record and the next record in the attribute table with the Pythagorean theorem to calculate distance. but can't figure a way to get to the properties of the next record. I'm not a great programmer but I can usually hack something together.

Can someone suggest a starting point for me?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 16, 2017 at 19:07
4
  • Populate additional field by oid-1 and join to itself Commented Aug 16, 2017 at 20:24
  • Perfect! That was the solution. I'd completely forgotten to follow the KISS principal. Keep It Simple Stupid. Commented Aug 16, 2017 at 22:58
  • Might not work on database fc if oid is not sequential Commented Aug 17, 2017 at 10:01
  • @FelixIP Looks like you have almost two sentences and an answer in your comments. Commented Aug 20, 2017 at 8:46

1 Answer 1

1

Populate additional field by OID - 1 and join to itself.

Please note that solution will always work for shapefiles (FID), but might fail for database feature class if OBJECTIDs are not sequential numbers

answered Aug 21, 2017 at 4:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.