I have counties mapped using polygons in Shapely with latitude/longitude for coordinates. Given a complex polygon x and single point y, how would I find the shortest distance between x and y as well as the heading needed?
Using the distance function in Shapely, I can get the closest distance, but I'm unable to come up with a fast solution to get the heading. I tried determining the closest point, but this solution was unreasonably slow to run on 10 polygons.
Best Answer
I've no idea if this works or if it's fast enough, but I'd try this:
What makes or breaks this approach is if the buffer intersects A or not (because buffer is a circle's approximation, it might not).
If you don't get an intersection, you could increase either:
until you get an intersection.
Here's a diagram of a buffer slightly bigger then the distance to illustrate what I mean: