-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate rust-geo-booleanop
algorithms directly into geo
?
#620
Comments
Is it stable enough? I’ve read it still lacks correctness for boolean op on some test cases. |
Maybe the geo-clipper crate could be considered instead. The C++ port of the AngusJ clipper library written originally in Pascal is a 1:1 port and seems to be quite stable since many years. It also has a nice inward/outward offsetting function on polygons, which I already tried. |
One advantage of |
Thank you for calling this out as this is something we should definitely consider. If you recall where you saw a discussion on correctness, would love to link to that from this issue. |
Yes, correctness in some cases is definitely still an issue, and I wouldn't advocate moving functionality into geo until we have a clear sense of where the failing cases are and whether existing efforts (robust etc) can help to resolve them (to be clear: I don't think this is a concern if the georust org were to adopt the crate). I would also prefer not to use geo-clipper. |
This seems to be the main issue around stability: 21re/rust-geo-booleanop#17 |
But if I remember correctly, the problem is deeply rooted with the data representation of the line sweep algorithm, which could get quite nasty to fix. The crate uses a tree to represent event that are linked to incoming and outgoing end points of a line segment, which are swept over with a line sweeping algorithm. The problem seems to be that the sorting of these events is not stable enough resulting in missing sweep events which ultimately result in a panic or broken result. Assuming, georust were to adopt the crate, I think if we could fix that issue, we would greatly forward development of the crate. |
Yes I believe so. But I know that @bluenote10 had proposed an alternative (splay tree based?) data structure and made some progress towards integrating it, and that @daef had done some work too. |
Yes and I still think this should all be fixable, but certainly requires some work. Due to a shift of priorities I didn't had time to finish it, but the ideas should be documented in the linked issue. |
rust-geo-booleanop
algorithms directly into geo
rust-geo-booleanop
algorithms directly into geo
?
Just to mention another repo, which may be usable in the next few months: |
Please don't integrate C or C++ libraries. I'm using geo in a wasm application, and you can't use those libraries together with Rust's wasm32-unknown-unknown target. |
It is vanishingly unlikely that we'll integrate any c++ libraries into |
I recently coded up boolean-ops based on the Martinez-Rueda-Freito algorithm here. I don't think the impl is 100% accurate to fp errors but seems to pass all the reference test-cases available in rust-geo-booleanop, incl. some where the latter panics. The performance is worse though: about 2x slower in the worst-case. However, the impl. is modular, and we hope to eventually get it to be accurate and fast. We also use the |
That sounds great to me! My vote is to merge the impl here. Having any accurate implementation (no matter how slow) is better than having none. |
💯 this! |
That sounds great @rmanoka! |
https://github.com/21re/rust-geo-booleanop
Related: #80, #81
Reach out to the maintainer? Add as a dependency? Offer to take over the crate? Copy and paste and update our license files?
The text was updated successfully, but these errors were encountered: