georust / geo

Rust geospatial primitives & algorithms
https://crates.io/crates/geo
Other
1.58k stars 198 forks source link

Multi-thread support for geo-types using Rayon #1257

Closed urschrei closed 2 weeks ago

urschrei commented 2 weeks ago

1246 proposes a multi-threaded variant of the unary union algorithm. Out of the box, this works on containers that impl IntoParallelIterator<Item = &'a Boppable>. MultiPolygon doesn't, because geo-types has very few dependencies, let alone Rayon. However, if we had optional Rayon support (and enabled it when it was enabled for geo) we could call it like this:

let poly_union = AllowMultithreading(&parcel_multipolygon).unary_union()

Instead of like this:

let poly_union = AllowMultithreading(&parcel_multipolygon.0).unary_union()

Which isn't very nice and forces us to use the exposed-implementation-detail .0 syntax.