Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Could you share a reproductible example ? In my case if i use unary_union on a separated MultiLinestring, it stays a MultiLinestring Commented Jan 25, 2024 at 18:21
  • @MagicMushroom I added the example the end of my question Commented Jan 25, 2024 at 18:34
  • In my opinion, th issue comes from the last part of the MultiLineString. If you separate every part of the MLS and ask of intersects or touches, the last (part 5) part will return a False with the 4th part. And you can figure out that part 4 and part 2 are actually the same. Commented Jan 26, 2024 at 9:08
  • Do you have any idea why shapely.intersection produces a MultiLineString at all? The given LineString should not be cut into a MultiLineString by the intersection. I added an image to the question how the given LineString looks like (blue line). I guess the problem has something to do with the line going back and forth the same way and that some points on the way back are exactly the same as on the way forward? When I provide a line to shapely.intersection that has no duplicate points everything is fine, it generates a simple LineString! Commented Jan 26, 2024 at 9:15