load_h3 | R Documentation |
load the duckdb geospatial data plugin
load_h3(conn = cached_connection())
conn |
A database connection object created using the
|
loads the extension and returns status invisibly.
https://github.com/isaacbrodsky/h3-duckdb
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.