pub fn k_ring(origin: H3Index, radius: i32) -> Vec<H3Index> {
    unsafe {
        let max = libh3_sys::maxKringSize(radius);
        let mut r = Vec::<H3Index>::with_capacity(max as usize);
        libh3_sys::kRing(origin, radius, r.as_mut_ptr());
        r.set_len(max as usize);
        r = r.into_iter().filter(|v| *v != 0).collect();
        r
    }
}
/// 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);
/// ```
Get all hexagons in a k-ring around a given center. The order of the hexagons is undefined.
Get all hexagons in a k - ring around a given center . The order of the hexagons is undefined .
pub fn k_ring(origin: H3Index, radius: i32) -> Vec<H3Index> {
    unsafe {
        let max = libh3_sys::maxKringSize(radius);
        let mut r = Vec::<H3Index>::with_capacity(max as usize);
        libh3_sys::kRing(origin, radius, r.as_mut_ptr());
        r.set_len(max as usize);
        r = r.into_iter().filter(|v| *v != 0).collect();
        r
    }
}
pub fn k_ring ( origin : H3Index , radius : i32 ) -> Vec < H3Index > { unsafe { let max = libh3_sys :: maxKringSize ( radius ) ; let mut r = Vec :: < H3Index > :: with_capacity ( max as usize ) ; libh3_sys :: kRing ( origin , radius , r . as_mut_ptr ( ) ) ; r . set_len ( max as usize ) ; r = r . into_iter ( ) . filter ( | v | * v != 0 ) . collect ( ) ; r } }
Get all hexagons in a k-ring around a given center.
Get all hexagons in a k - ring around a given center .
origin
H3Index
radius
i32
origin
H3Index
radius
i32