I am trying to split a line with multiple points. I adopt the solution in here, but sometimes it does not work.
from shapely.geometry import LineString, MultiPoint
from shapely.ops import split
line = LineString([(0.1, 0.01), (0.001, 0.001)])
splitter = MultiPoint([line.interpolate((i/6), normalized=True) for i in range(1, 6)])
gcline = split(line, splitter)
str(gcline)
The output is
'GEOMETRYCOLLECTION (LINESTRING (0.1 0.01, 0.001 0.001))'
I guess it is because the line is too short. The method works fine for LineString([(0.1, 0.1), (0.001, 0.001)]).