Calculating ID Field by Spatial Relationship

675
2
Jump to solution
07-08-2021 02:41 PM
ChrisGAEG
Occasional Contributor

Hi all, 

I want to know if I can calculate an ID field (separate from ObjectID) of a line feature which is numbered sequentially based on how close or far away a line segment is from a point. For instance, lines that intersect the 'origin' point will be lower numbers and lines that are further away from the origin will be ordered sequentially higher. 

I included a picture so hopefully visualize what I am trying to do. Any input here is greatly appreciated. 

1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

I'm not exactly sure form the image provided.  Are you only interested in that one point? Generate Near Table (Analysis)—ArcGIS Pro | Documentation would do it for you, then just order by near_distance in the output table and generate a sequential ID How To: Sort and create a sequentially ordered ID field in an attribute table in ArcGIS Pro (esri.co... (or the OID in the table is probably already ordered this way). Then join the table back to the lines using near_fid.

View solution in original post

2 Replies
DavidPike
MVP Frequent Contributor

I'm not exactly sure form the image provided.  Are you only interested in that one point? Generate Near Table (Analysis)—ArcGIS Pro | Documentation would do it for you, then just order by near_distance in the output table and generate a sequential ID How To: Sort and create a sequentially ordered ID field in an attribute table in ArcGIS Pro (esri.co... (or the OID in the table is probably already ordered this way). Then join the table back to the lines using near_fid.

ChrisGAEG
Occasional Contributor

This will work! And you were right, the OID in the table is ordered sequentially and will serve as the segment id for the output of the script. Thanks a lot for your help.