georust / geo

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

Draft: feat: implement a safe wrapper for boolops #1073

Closed RobWalt closed 10 months ago

RobWalt commented 10 months ago

I've been playing around with an idea I had recently to fix up the BoolOps with a wrapper. The issue with the current implementation of BoolOps is some inconsistency which is triggered if one point of the left hand side geometry lies on top of a line of the right hand side geometry. To prevent this I just wrote a wrapper which checks if that's the case and if so, moves the point a tiny bit to a place where it's "safer", i.e. into a region where no line of the left hand side geometry is near.

The PR currently includes a lot of tests which I accumulated from all the issues that are open regarding this matter. They all seem to work. However, be aware:

I'll clean this up a bit further in the coming days:

urschrei commented 10 months ago

@rmanoka almost certainly of interest to you

RobWalt commented 10 months ago

I'll add some comments tomorrow so I would highly recommend waiting until then before trying to understand everything just from the code 😅

RobWalt commented 10 months ago

I've tested it and that still doesn't seem to work. Here's a simple app to test it out

https://github.com/RobWalt/is-geo-boolops-still-broken

frewsxcv commented 10 months ago

@RobWalt Did you mean to close this?

RobWalt commented 10 months ago

Yes, both have flaws and special cases that still fail. It's no use and we probably need another approach. I'm working on something though