Find nearest start and end geometries to a line

614
1
05-03-2022 10:56 AM
Labels (2)
Marie
by
New Contributor

I have a dataset of projects (lines) and markers (points) as shown in the image below. I need to update the projects dataset so that the closest IDs to the start/end point of the projects are included in the attribute table as 'StartID' and 'EndID'. How would I approach this?

Marie_0-1651600525576.png

 

0 Kudos
1 Reply
DanLee
by Esri Regular Contributor
Esri Regular Contributor

The following steps can get what you need or pretty close to what you need:

1. Run Feature Vertices To Points tool with Start Point option on your lines. Let's name the output StartPts, which carries the line FIDs in ORIG_FID field. Repeat this with End Point option; name the output EndPts.

2. Run Near tool on StartPts with your marker points as the Near Features. Specify a reasonable Search Radius if necessary. And replace the default NEAR_FID with START_MKFID (start marker FID). You will get a new field START_MKFID with the marker points FIDs.  Repeat this for EndPts to get a new field END_MKFID.

3. Run Join Field tool to join StartPts with the lines and transfer START_MKFID to the lines.  Repeat this to join EndPts with the lines and transfer END_MKFID to the lines.

Hope that helps.