enter image description here

I want to find the closest road for point star. By using the Near tool in ArcMap, I can get the closet distance a since the closest road is road 1. However, following the red arrow direction, the closest road is road 2.

I am just wondering does anybody know any function in arcpy or other libraries that can calculate distance b.

closed as off-topic by Midavalo Dec 26 '17 at 1:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – Midavalo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to GIS SE! As a new user please take the tour to learn about our focused Q&A format. A question asking for help writing code should include a snippet of the code you've already tried, and details of what happens when you try it. You can edit your question to add additional information. – Midavalo Dec 26 '17 at 1:15

If you want to get the road based on Bearing, then you can translate below steps into code:

  • Draw a virtual line from start point (A) to specific distance while taking into consideration the bearing. Bearing Distance to line
  • Virtual line will intersect with Road # 2 (it may be several intersections)
  • Export Intersections as feature class of type POINT. Intersections
  • Get the nearest point from Output feature class to Point A. Near Tool

One way to achieve this is to create a line from your star to an arbitary point in the direction of your arrow. You would then intersect that line with your line data. You would then have a series of points and you take the nearest. The "to" point could be some distance you know that will always create an intersection, such as the extent of your line dataset.

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