h3_line: Get Line Between Hexagons

Description Usage Arguments Details Value Note Examples

View source: R/algorithms.R

Description

Given two H3 indexes, return the line of indexes between them (inclusive).

Usage

1
h3_line(origin, destination)

Arguments

origin, destination

H3indices to draw line.

Details

This function may fail to find the line between two indexes, for example if they are very far apart. It may also fail when finding distances for indexes on opposite sides of a pentagon.

Value

A list of h3indices drawing line.

Note

Lines are drawn in grid space, and may not correspond exactly to either Cartesian lines or great arcs.

Examples

1
2
3
4
5
## Not run: 
hexagons <- geo_to_h3(quakes, lat, long) 
h3_line(sample(hexagons$hex, 1), sample(hexagons$hex, 1))

## End(Not run)

JohnCoene/h3inr documentation built on Oct. 30, 2019, 7:57 p.m.