geoarrow / geoarrow-rs

GeoArrow in Rust, Python, and JavaScript (WebAssembly) with vectorized geometry operations
http://geoarrow.org/geoarrow-rs/
Apache License 2.0
257 stars 17 forks source link

Implement conversion to geometry arrays on `AsRef<[G]>` where `G: GeometryTrait` #261

Open kylebarron opened 11 months ago

kylebarron commented 11 months ago

Ideally, this should allow converting either from a Vec<G> or &[G]. I got errors where it wanted [G] to be a trait object

kylebarron commented 11 months ago

In https://github.com/geoarrow/geoarrow-rs/pull/288 it was changed to be implemented on a slice but not vec. it would still be nice to get this implemented on AsRef<[G]>, but I had issues getting that to work last time I tried.

kylebarron commented 1 week ago

I hit issues recently where I couldn't implement this both on [G] and [Option<G>] because the upstream G implementation could in the future add an impl on Option<G>. Still not sure the best way to handle this. Perhaps, we just can't have them both as blanket implementations of From