-
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
Using BooleanOp with geo #32
Comments
Ok, after a while, I switched to using
|
So, in the end I followed the solution described here use geo_booleanop::boolean::BooleanOp;
use old_geo_types::Polygon;
pub fn clip(
polygon: &old_geo_types::Polygon<f64>,
fill_shapes: &[old_geo_types::Polygon<f64>],
) -> Vec<old_geo_types::Polygon<f64>> {
fill_shapes
.iter()
.flat_map(|shape| {
polygon
.intersection(shape)
.iter()
.cloned()
.collect::<Vec<Polygon<f64>>>()
})
.collect::<Vec<Polygon<f64>>>()
}
geo = "0.20.0"
geo-booleanop = "0.3.2"
geo-types = "0.7.4"
old-geo-types = { package = "geo-types", version = "0.6.2" } |
The latest release of I'm curious if your problem would equally go away (without the workaround) if you used geo-booleanop from github:
BTW - this kind of opaque error due to redundant incompatible versions is a common pain point in rust. Maybe you're already aware, but a tool I find useful is:
Which will show you any crates being included more than once. Seeing multiple versions of geo-types is sometimes OK if they live in non-overlapping code, but usually it's undesirable even then. |
Oh, I didn't know that! I'll try to use your advice, thank you! |
Yaay, it worked! Thank you very much! |
Hello!
I'd like to ask a beginner question which I haven't found answer for (or I was looking for it badly 😅)
I use
geo
(notgeo_types
) in my project, and while trying to perform an intersection operation like this:I get an error from the VSCode:
I see that, contrary to the README of this project,
geo_booleanop
usesgeo_types
instead ofgeo
. Is it possible to use this library withgeo
?Thank you for help!
The text was updated successfully, but these errors were encountered: