I am working on vessel tracking. I have setup route path, and vessel current position. Now my aim is to add that current position point to the path and update it. and calculate the length of linestring and time duration of whole line(start to end) and remain line(from current position to end). Now my main question is how can add the point to the LineString in order to update the route? Below, I have provided the my input linestring and current point data. also output of line and point. Data:
p = {'route': [{'path': [[51.51309, 0.4836599999999862],
[51.512222970577746, 0.4838196951935174],
[51.50817683327391, 0.4845649394298732],
.
.
[26.160997649670072, 56.29158290493038],
[25.234004681463745, 55.29187512793891],
[25.035363331133816, 55.07765203286928],
[25.00255, 55.10811000000001]],
'type': 'SEA'}]}
l_path=p['route'][0]['path']
path = LineString(l_path)
I want to connect this point to the linestring:
position = Point(13.752724664396988, 56.42578125)
Line and point output:
Thanks in advance.