I know how to go from
line = LineString([(0, 0), (1, 1), (2, 2)])
to
LINESTRING ((0 0), (1 1), (2 2))
But not the other way around. How do I do this?
The reason I need to do this is that I want to be able to apply the following function to split my LINESTRINGS into it sides.
from shapely.geometry import LineString, LinearRing
def segments(curve):
return list(map(LineString, zip(curve.coords[:-1], curve.coords[1:])))
line = LineString([(0, 0), (1, 1), (2, 2)])
line_segments = segments(line)
for segment in line_segments:
print(segment)
and it cannot be applied to wkt representations of linestrings.