georust / geo

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

LineStringSegmentize returning n - 1 linestrings at small distances #1106

Closed JosiahParry closed 8 months ago

JosiahParry commented 8 months ago

Floating point strikes again.

When line segmentizing very small distances n - 1 linestrings are returned. This is, of course, due to floating point precision. The solution is to reduce the distance between densified points by f64::EPSILON.

Fixes https://github.com/ropensci/stplanr/issues/552 and https://github.com/JosiahParry/rsgeo/issues/34