Description Usage Arguments Value Note Examples
Get all hexagons in a k-ring around a given center ordered by distance from the origin.
1 | k_ring_distances(h3_index, ring_size = 1)
|
h3_index |
character vector representing H3 indexes |
ring_size |
number of rings |
data frame with columns h3_index and distance (ring number); list of data frames if multiple centers are supplied
The order of the hexagons within each ring is undefined.
1 2 3 4 5 6 7 8 9 | coords <- c(37.3615593, -122.0553238)
h3_index <- geo_to_h3(coords)
buffer <- k_ring_distances(h3_index, 2)
buffer[buffer$distance %in% c(0, 2), ]$h3_index %>%
h3_to_geo_boundary() %>%
geo_boundary_to_sf() %>%
sf::st_geometry() %>%
plot(col = "red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.