Open
Description
Shapely/geos doesn't seem to merge touching segments. cuSpatial does.
In [1]: from shapely.geometry import *
In [2]: l = LineString([(0.0, 0.0), (3.0, 3.0)])
In [3]: l2 = LineString([(0.0, 1.0), (1.0, 0.0), (2.0, 2.0), (0.0, 0.0)])
In [4]: l.intersection(l2)
Out[4]: <MULTILINESTRING ((0 0, 0.5 0.5), (0.5 0.5, 2 2))>
This is likely due to how union works in shapely...
In [4]: shapely.union(LineString([(0.0, 0.0), (0.5, 0.5)]), LineString([(0.5, 0.5), (1.0, 1.0)]))
Out[4]: <MULTILINESTRING ((0 0, 0.5 0.5), (0.5 0.5, 1 1))>
In [5]: shapely.union(LineString([(0.0, 0.0), (0.75, 0.75)]), LineString([(0.5, 0.5), (1.0, 1.0)]))
Out[5]: <MULTILINESTRING ((0 0, 0.5 0.5), (0.5 0.5, 0.75 0.75), (0.75 0.75, 1 1))>
Originally posted by @isVoid in #852 (comment)
Activity
pairwise_linestring_intersection
#852