ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
alteryx Community

# Alteryx Designer Discussions

## Find Nearest: Coordinates of the nearest point on a line

5 - Atom

Is there a way to get the coordintes of the nearest point (on the line) from a point to that line?

I am using the Find Nearest tool to calculate the distance from a set of points to a spatial line. I then would like to calculate the distance from this touchpoint to annother point, but for that I need to have the coordinates of that point.

12 - Quasar

Hi @Janosch,

Is the below image what you are looking for? You can get the intersection point by using the Distance tool. Each Point of Interest will need to be in the same record as the Poly line. This method would use brute force so you would have to run all points of interest then rank them to find the closest to the route, so if you don't have too many this should work fine :).

Nearest Intersection Point to Route

In the table below are the fields from the Distance tool that could be used to rank the closest Point of Interest to your route.

 DistanceMiles Direction DriveTime DriveDistanceMiles 4.594073 N 29.27 9.86
5 - Atom

Thanks to your reply but this doesn't really solve my problem. I do not need the the closet point to the route, I need the point on the route which is closet to the point given.

12 - Quasar

Hi @Janosch,

So this can easily solve that problem. The point the  distance tool creates within the poly line is the closest point on the route to the point of interest. You can do it so the closest point in the poly line is within the line or the edge of the poly line (though the difference should be marginal if this a driving route).

Just ignore the bottom section with the table in the above post and you have what you are looking for.

Labels