grid_path {h3jsr}R Documentation

Path between H3 cells

Description

This function returns a path of H3 cells between a start and end cell (inclusive).

Usage

grid_path(origin = NULL, destination = NULL, simple = TRUE)

Arguments

origin

Character vector or list of 15-character indices generated by H3.

destination

Character vector or list of 15-character indices generated by H3.

simple

Logical; whether to return a vector of outputs or a list object containing both inputs and outputs.

Value

A vector of h3 cells of form c(origin, c(path), destination).

Note

Examples

## Not run: 
nc <- sf::st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
nc_pts <- sf::st_centroid(nc[c(1, 2), ])
nc_6 <- point_to_cell(nc_pts, res = 6)
# find a path between these two addresses:
grid_path(nc_6[1], nc_6[2], simple = TRUE)


## End(Not run)

[Package h3jsr version 1.3.1 Index]