load the duckdb geospatial data plugin
Usage
load_h3(conn = cached_connection())
Examples
if (FALSE) { # interactive()
library(dplyr)
load_h3()
ex <- system.file("extdata/spatial-test.csv", package="duckdbfs")
zoom <- 9L # Zoom must be explicit integer, L
query <- ex |>
open_dataset(format = "csv") |>
mutate(h3id = h3_latlng_to_cell_string(latitude, longitude, zoom))
# as data.frame
collect(query)
# write to a file
path <- tempfile(fileext = ".h3j")
query |> to_h3j(path)
}