I have a linestring in shapely which I'm converting into buffer.
>>> from shapely.geometry import LineString
>>> line = LineString([(0, 0), (1, 1), (0, 2), (2, 2), (3, 1), (1, 0)])
>>> dilated = line.buffer(0.5)
Now I'm trying to convert the dilated linestring to the original linestring. So I tried doing this:
>>> original = dilated.buffer(0.0)
But it's returning a polygon instead of a linestring. How can I get the original linestring from the polygon in shapely ?
.buffer()with negative distances. It would serve as central line, I think. – jjmontes Mar 19 '20 at 02:40