I am trying to find the shortest linestring between two points. There is a constraint that there is an n-sided polygon possibly directly between the 2 points. I am not allowed to cross through the polygon but only pass through its edges.
eg.
start = (2,0)
end = (0,1)
poly = [(1,0),(1,1),(1,2),(2,1)]
passing it through the function would output 2.41
so far I have
from shapely.geometry import LineString, Polygon, Point
def shortest_linestring(start, end, poly):
poly = Polygon(poly)
p1 = Point(start)
p2 = Point(end)
but I am completely stumped as to what to do next. Any hint would be appreciated.