georust / geo

Geospatial primitives and algorithms for Rust
https://crates.io/crates/geo
Other
1.49k stars 194 forks source link

Fix LineSegmentize where number of linestrings is less than n #1077

Closed JosiahParry closed 10 months ago

JosiahParry commented 10 months ago

The bug: LineStringSegmentize trait can return n - 1 LineStrings. This happens when the last Line being iterated over needs to be split into 2 separate Lines.

The fix: previously, the definition did not permit splitting the last Line iterator. This PR allows the last Line to be split and checks after the for loop has completed iteration if the length is equal to n.

Closes: https://github.com/georust/geo/issues/1075

JosiahParry commented 10 months ago

Closing in favor of #1078