JosiahParry / h3o

An R interface to Rust's h3o library
Other
19 stars 1 forks source link

Add "Covers" containment mode to ```sfc_to_cells()``` #8

Closed bbrunckh closed 13 hours ago

bbrunckh commented 16 hours ago

Would it be possible to include the more recent "Covers" containment mode in next update? https://docs.rs/h3o/latest/h3o/geom/enum.ContainmentMode.html#variant.Covers

This mode behaves the same as IntersectsBoundary, but also handles the case where the geometry is being covered by a cell without intersecting with its boundaries. In such cases, the covering cell is returned.

bbrunckh commented 16 hours ago

Brilliant package, thanks! Not in your current benchmarks, buth3o::sfc_to_cells() so much faster than h3jsr::polygon_to_cells() even with slower containment modes.

JosiahParry commented 13 hours ago

I've gone ahead and added the covers method :)

JosiahParry commented 13 hours ago

https://github.com/JosiahParry/h3o/commit/c23a794c1a454c7986f6cbb64726be91c13326cd