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?
-
Populate additional field by oid-1 and join to itselfFelixIP– FelixIP2017年08月16日 20:24:31 +00:00Commented Aug 16, 2017 at 20:24
-
Perfect! That was the solution. I'd completely forgotten to follow the KISS principal. Keep It Simple Stupid.user103866– user1038662017年08月16日 22:58:47 +00:00Commented Aug 16, 2017 at 22:58
-
Might not work on database fc if oid is not sequentialFelixIP– FelixIP2017年08月17日 10:01:19 +00:00Commented Aug 17, 2017 at 10:01
-
@FelixIP Looks like you have almost two sentences and an answer in your comments.PolyGeo– PolyGeo ♦2017年08月20日 08:46:45 +00:00Commented Aug 20, 2017 at 8:46
1 Answer 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
Explore related questions
See similar questions with these tags.