Is there a clever way to traverse a line string up until a point and return the distance to that point? As an example:
a = LineString([(1, 1), (9, 1), (9, 6), (4, 6), (4, 3)])
p = Point((4,4,))
The distance from the start of a, to point p would be:
8 # 9-1
5 # 6-1
5 # 9-4
+ 2 # 2, p intesects line segment after 2 units
= 20
I suppose I can just traverse the line and summing up the distance until p intersects the line segment, and calculate the last bit, but I get a feeling that there is something more elegant in the API that I haven't yet discovered.
Never heard of shapely until today, and I'm quite impressed by what I have seen so far.