I have a polygon layer and a polyline layer. I got the centroids of the polygon layer and used the Near Tool to find the distance from the closest point from the centroids to the polyline layer.

One thing I tried doing was to create a buffer from the points based on the Near value then finding the intersection but that did not work well.

One suggestion I got but was unsure what he meant and am unable to follow up with is:

Use the Near function (not Generate Near Table nor Point Distance) with your original point layer that you added the coordinates to and specify another point layer as your near points. When the function is done, two variables will be added to the original point layer that contains the x and y coordinates of the point nearest to it, those will be your end x and y.

I think what confuses me is that I am not sure if I am supposed to find the nearest point using the polyline layer rather than the point layer.

Question: How can I find the X/Y coordinates of nearest point on the polyline in order to create a line between that set of X/Y coordinates and a centroid point?

The end result is supposed to be: The end result is that I want to make a line between the centroid and the nearest point on the polyline layer and connect it to the polyline layer. I tagged this Network Analyst because eventually I want to make a connected network.

1 Answer 1


Two fields named "NEAR_X" and "NEAR_Y" will be add to the Centroid attribute table by the Near Tool. The Centroid coordinates can be added by executing "Add XY Coordinates", you should see Point_X and Point_X columns. You can run "XY to Line" to create the line from Point_X,Point_Y to Near_X,Near_Y.

  • Where do I find the correct X/Y points along the polyline? The centroid stuff is fine.
    – giscard78
    Mar 1, 2016 at 17:17
  • the closest point xy is added to the centroid point table, near_x, near_y. Do you run the Near tool?
    – klewis
    Mar 1, 2016 at 17:30
  • Oh, it was so obvious, the Location check box! Of course. Thank you! If you don't mind, how can I format the data to do Points to Lines for Centroid_X, Centroid_Y and Near_X, Near_Y ?
    – giscard78
    Mar 1, 2016 at 17:55
  • use your Centroid FC for input, define the output, point_x, point_y, near_x, near_y. Seems pretty simple.
    – klewis
    Mar 1, 2016 at 18:21
  • I was using Points to Line rather than XY to Line. I used XY to Line and it worked! Thanks!
    – giscard78
    Mar 1, 2016 at 19:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.