2

I am trying to make a polygon of the boundaries of traffic intersections using a python script. I want to automatically create intersection polygons made of arcs and lines connecting them. Essentially, what I need to create are lines labeled in red below to finish off the polygon.

How do I make the script "know" which two arc endpoints to connect to make the red lines? If I create a line between each point and its nearest neighbor, it could mess up if one road is wider than the other. Also, how could I make the line extend perpendicularly from the ac endpoint until it hits the other end of the intersection? enter image description here

  • 1
    Are there road name attributes? Road A could be going East-West, and Road B could be North South. Then, you could use the name of Road A and B to link them. You know the end points of Road A need to match with Road B. Alternatively, you could get the endpoint coordinates and sort them clockwise, for example. Then connect them in order. – Fezter Aug 3 '16 at 22:25
1

Here is an approximation assuming that you have individual lines representing your roads:

  1. Buffer your road lines
  2. Intersect the buffered polygonsenter image description here

The result should look approximately similar to the picture below:

Your Answer

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

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