-
Notifications
You must be signed in to change notification settings - Fork 200
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
Allow configuring of the i_overlay
Rayon transitive dep. Document more features.
#1250
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,11 @@ rust-version = "1.75" | |
categories = ["science::geo"] | ||
|
||
[features] | ||
default = ["earcutr", "spade"] | ||
default = ["earcutr", "spade", "i_overlay", "multithreading"] | ||
use-proj = ["proj"] | ||
proj-network = ["use-proj", "proj/network"] | ||
use-serde = ["serde", "geo-types/serde"] | ||
multithreading = ["i_overlay/allow_multithreading"] | ||
|
||
[dependencies] | ||
earcutr = { version = "0.4.2", optional = true } | ||
|
@@ -30,7 +31,7 @@ proj = { version = "0.27.0", optional = true } | |
robust = "1.1.0" | ||
rstar = "0.12.0" | ||
serde = { version = "1.0", optional = true, features = ["derive"] } | ||
i_overlay = "1.7.2" | ||
i_overlay = { version = "1.7.2", optional = true } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO boolean operations are such a core feature that I wouldn't oppose Also, don't you want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes great catch, I meant to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree boolean operations are important, but the success of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be clear, we've had non optional boolean operations in geo for years now. So if anyone is building geo with I personally have a slight preference for "make rayon optional but bool_ops mandatory" - because of the above breakage and also the additional configuration and documentation complexity outweighs the benefits of letting people fine tune, in this case, in my estimation. But it's only a slight preference. Question: if we break the no-default-features build, do we need to make another bump to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That hadn't occurred to me. I'm now also in the "slight preference for mandatory" camp. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still have a preference for making the bool ops stuff optional but it sounds like there's agreement about making it required so I'll just change it |
||
|
||
[dev-dependencies] | ||
approx = ">= 0.4.0, < 0.6.0" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ | |
//! | ||
//! ## Boolean Operations | ||
//! | ||
//! - **[`BooleanOps`]**: combine or split (Multi)Polygons using intersecton, union, xor, or difference operations | ||
//! - **[`BooleanOps`]**: combine or split (Multi)Polygons using intersecton, union, xor, or difference operations. Requires the `"i_overlay"` feature, which is enabled by default. | ||
//! | ||
//! ## Outlier Detection | ||
//! | ||
|
@@ -112,7 +112,7 @@ | |
//! | ||
//! ## Triangulation | ||
//! | ||
//! - **[`TriangulateEarcut`](triangulate_earcut)**: Triangulate polygons using the earcut algorithm (requires the `earcutr` feature). | ||
//! - **[`TriangulateEarcut`](triangulate_earcut)**: Triangulate polygons using the earcut algorithm. Requires the `"earcutr"` feature, which is enabled by default. | ||
//! | ||
//! ## Winding | ||
//! | ||
|
@@ -177,9 +177,25 @@ | |
//! | ||
//! The following optional [Cargo features] are available: | ||
//! | ||
//! - `proj-network`: Enables [network grid] support for the [`proj` crate]. After enabling this feature, [further configuration][proj crate file download] is required to use the network grid | ||
//! - `use-proj`: Enables coordinate conversion and transformation of `Point` geometries using the [`proj` crate] | ||
//! - `use-serde`: Allows geometry types to be serialized and deserialized with [Serde] | ||
//! - `i_overlay`: | ||
//! - Enables the `i_overlay` crate, which provides boolean operations on geometries. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we call this feature There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming we won't have a separate boolean operations implementation in the future that doesn't depend on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given how long it's taken to get to this point, that seems unlikely. Not impossible, but a small risk IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In some hypothetical world where we get a second boolops implementation, we'd probably be revisiting the feature flags anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case my original concern wasn't clear: I think a user perusing the feature flags will more quickly understand what a The fact that we're using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool I'll change it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, I'm just going to remove the feature |
||
//! - ☑ Enabled by default. | ||
//! - `earcutr`: | ||
//! - Enables the `earcutr` crate, which provides triangulation of polygons using the earcut algorithm. | ||
//! - ☑ Enabled by default. | ||
//! - `proj-network`: | ||
//! - Enables [network grid] support for the [`proj` crate]. | ||
//! - After enabling this feature, [further configuration][proj crate file download] is required to use the network grid. | ||
//! - ☐ Disabled by default. | ||
//! - `use-proj`: | ||
//! - Enables coordinate conversion and transformation of `Point` geometries using the [`proj` crate] | ||
//! - ☐ Disabled by default. | ||
//! - `use-serde`: | ||
//! - Allows geometry types to be serialized and deserialized with [Serde]. | ||
//! - ☐ Disabled by default. | ||
//! - `multithreading`: | ||
//! - Enables multithreading support for the `i_overlay` crate. | ||
//! - ☑ Enabled by default. | ||
//! | ||
//! # Ecosystem | ||
//! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
multithreading
feature also enablesi_overlay
- is that intended?If so, then I think we should call it something like
i_overlay_multithreading
(or per my other comment,bool_ops_multithreading
)Though I could imagine a use case for a
multithreading
flag in geo more generally. In which case this name is good as is! But we should change the definition to:multithreading = ["i_overlay?/allow_multithreading"]
Which enables
allow_multithreading
oni_overlay
if we're usingi_overlay
, but otherwise don't enablei_overlay
just because someone tried to build geo withmultithreading
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My own preference is:
multithreading = ["i_overlay?/allow_multithreading"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it! I didn't know about this syntax