-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support H3 spatial indexed data via the h3j extension? #68
Comments
I sketched this out in my fork by adding a My approach adds a new function url = "https://inspide.github.io/h3j-h3t/examples/h3j/sample.h3j"
maplibre(center=c(-3.704, 40.417), zoom=15, pitch=30) |>
add_h3j_source("h3j_testsource",
url = url
) |>
add_fill_extrusion_layer(
id = "h3j_testlayer",
source = "h3j_testsource",
fill_extrusion_color = interpolate(
column = "value",
values = c(0, 21.864),
stops = c("#430254", "#f83c70")
),
fill_extrusion_height = list(
"interpolate",
list("linear"),
list("zoom"),
14,
0,
15.05,
list("*", 10, list("get", "value"))
),
fill_extrusion_opacity = 0.7
)
|
This looks awesome! Yes I'd be interested in a PR.
I'm wondering, given your comment: would this be a method we could use for efficient plotting of high-density point data, e.g. bin the data and visualize without having to send a hefty GeoJSON over to be rendered? |
@cboettig one thing I notice is that the repo does not appear to be maintained (although it's good to know that it still works); perhaps we fork it and modify as needed - I saw your open issue. I also note that they are using a very old version of maplibre on their side, so we'd want to make sure it works with anything new. |
@walkerke Thanks Kyle! These are good questions. Yeah I hear you on the maintenance side, that's a good question. It have it working fine in my fork, so at least so far seems good.
yes, this is precisely my use case. e.g. GBIF is a biodiversity occurrence dataset of some 3 billion rows, about half a terrabyte as parquet point data. Here is a demo app that bins the data by H3 hexes at various resolutions. You can aggregate data for the country or the world using low zooms (h4 or say) quite quickly, or zoom into a state or national park and aggregate at much finer resolutions: https://streamlit.carlboettiger.info (this one python/streamlit based, but we can do the same in R with your package now, and probably make it look much nicer :-) ) I should note that deck.gl also has support for h3, but that would not integrate into the existing maplibre syntax for I don't know javascript but yeah I think we could fork it if necessary. |
Would you be open to a PR adding support for H3-indexed data?
I think the simplest approach would use h3j, as linked from the maplibre plugin page.
Motivation: H3 is a powerful hierachical spatial index. Because it is supported through a duckdb extension, R users can leverage dplyr to efficiently calculate and manipulate h3-indices, e.g. in group-by/summarise aggregations and joins.
The text was updated successfully, but these errors were encountered: