Replies: 2 comments 10 replies
-
FWIW there's also concave hull in geo: https://docs.rs/geo/latest/geo/algorithm/concave_hull/trait.ConcaveHull.html |
Beta Was this translation helpful? Give feedback.
-
Do you mean that order of the set might not conform to [ If it's the latter, how is that different from "they might not all be directed in the same direction"? Looking at the JTS docs (GEOS will do the same thing), I wonder whether we don't already have the internal machinery to do this, in the form of the There's a good reason for that, which is that it's tricky to write an algorithm that will do the right thing (produce a valid geometry) without some constraints on the input: otherwise you essentially might have to guess (in the form of some heuristic) how to actually connect lines into rings, and there's no guarantee it'll be correct. |
Beta Was this translation helpful? Give feedback.
-
I have a set of
LineString
s which form the boundaries of a polygon. Unfortunately, I can't guarantee that they are in the correct order, or that the points in them are all directed in the appropriate direction.How can I merge them into a single
Polygon
? Convex Hull won't do it, as some polygons will be C-shaped. I want something like Shapely'spolygonize
. I'm consideringrs_concaveman
, but wanted to first check I wasn't missing something already in thegeo
universe.Beta Was this translation helpful? Give feedback.
All reactions