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*

2
  • Thank you, this was indeed almost the solution. In order to also obtain the linework of the outer boundary, I added an additional row with geometry df.union_all().boundary to the boundary dataframe. However, many of the resulting geometries are actually MultiLineStrings. This can be fixed with a simple df.geometry = df.geometry.line_merge(), but I don't know why it is happening in the first place. Commented Sep 26, 2024 at 12:05
  • 1
    Seems to be a shapely problem: even (a := LineString(((0,0), (0,1), (1,1)))).intersection(a) results in a MultiLineString. Commented Sep 26, 2024 at 12:45