I have a shapefile representing roads (Black) and I need to know whether another line object (Red) is to the side of it. Including the orientation between them, to define whether the Red line lies to the North, East, South, West or if there is no line at all.

It is accurate enough to find whether for each segment it is on within the 90 degree range as the lines sometimes curve so the angle and orientation will change.

You can see in the images that some of the lines are complex, sometimes splitting and merging.

I have attempted adding points along the lines and then drawing lines to the nearest hub to then find the angle of the line but unless I draw a point every meter (not practical) the nearest points are not close enough and the angle doesn't take the shortest path.

Showing an example of the red lines being sometimes to the east and west

Complex example where there are crossovers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.