[−][src]Function libh3::k_ring
pub fn k_ring(origin: H3Index, radius: i32) -> Vec<H3Index>
Get all hexagons in a k-ring around a given center. The order of the hexagons is undefined.
Arguments
origin
- The center of the ring.radius
- The radis of the ring in hexagons, which is the same resolution as the origin.
let expected_kring = vec![ 0x8a2a1072b59ffff, 0x8a2a1072b597fff, 0x8a2a1070c96ffff, 0x8a2a1072b4b7fff, 0x8a2a1072b4a7fff, 0x8a2a1072b58ffff, 0x8a2a1072b587fff, ]; let r = libh3::k_ring(0x8a2a1072b59ffff, 1); assert_eq!(r, expected_kring);