View source: R/local_coordinates.R
get_local_cell | R Documentation |
This function returns H3 destination cells for local i, j coordinate pairs anchored by an H3 origin cell.
get_local_cell(origin = NULL, i = NULL, j = NULL, simple = TRUE)
origin |
Character; 15-character cell index generated by H3. A vector of indexes can also be supplied. |
i |
a single i coordinate or vector of same, generated by
|
j |
a single j coordinate or vector of same, generated by
|
simple |
Logical; whether to return a vector of outputs or a data frame containing both inputs and outputs. |
If simple = TRUE
, a character vector of destination H3 cells.
If not, a data frame containing columns origin, i, j, destination.
The coordinate space used by this function may have deleted regions or warping due to pentagonal distortion.
Coordinates are only comparable if they come from the same origin cell.
Failure may occur if the destination is too far away from the origin or if the destination is on the other side of a pentagon.
This function is experimental, and its output is not guaranteed to be compatible across different versions of H3.
# Get local coordinates for a nearby cell local <- get_local_ij(origin = '86be8d12fffffff', destination = '86be8d127ffffff') # Convert back to destination cell get_local_cell(origin = '86be8d12fffffff', i = local[, 1], j = local[, 2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.