-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix fill_queue to avoid invalid Rect initialization #16
Comments
Yes good point, we can probably just introduce a module local |
I went ahead and did as you suggested, it's fairly clean: https://github.com/nick-parker/rust-geo-booleanop/tree/internal-rect Unfortunately the tests module doesn't compile because geojson hasn't bumped to geo-types 0.5.x yet, but this is all ready to go whenever they get around to it. I'm hoping it doesn't happen til the next numbered release of geo-types, because I need this commit included for my project: |
I had a quick look into how
Note that in your branch you are setting both min and max to positive infinite, so don't be surprised if you get weird results ;). And doesn't your approach panic with an empty polygon? When you call |
Right on all counts! I didn't know about the limitations of automatic inlining across crates, I definitely assumed those getters would compile to the same code as before. The cost of the check hadn't occurred to me either, I'll see about converting everything to an internal bbox structure. |
I mostly fixed this for myself, but I'm not making a PR yet because geojson needs to version-bump geo_types before your test fixtures will work with this change.
https://github.com/nick-parker/rust-geo-booleanop
The current version of geo_types::rect::Rect enforces validity, so the sbbox and cbbox initializations with inf and neg_inf panic. It's easy enough to fix by just passing separate min, max mut coords through fill_queue and then constructing the bboxes afterward.
The text was updated successfully, but these errors were encountered: