pub fn k_ring_distances(origin: H3Index, radius: i32) -> Vec<(H3Index, i32)> {
    unsafe {
        let max = libh3_sys::maxKringSize(radius);
        let mut indexes = Vec::<H3Index>::with_capacity(max as usize);
        let mut distances = Vec::<i32>::with_capacity(max as usize);

        libh3_sys::kRingDistances(origin, radius, indexes.as_mut_ptr(), distances.as_mut_ptr());
        indexes.set_len(max as usize);
        distances.set_len(max as usize);

        indexes
            .into_iter()
            .zip(distances.into_iter())
            .filter(|v| v.0 != 0)
            .collect::<Vec<(H3Index, i32)>>()
    }
}
/// Get all hexagons in a k-ring around a given center, in an array of arrays
/// ordered by distance from the origin. The order of the hexagons within each ring 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_distances = vec![
///   (0x8a2a1072b59ffff, 0),
///   (0x8a2a1072b597fff, 1),
///   (0x8a2a1070c96ffff, 1),
///   (0x8a2a1072b4b7fff, 1),
///   (0x8a2a1072b4a7fff, 1),
///   (0x8a2a1072b58ffff, 1),
///   (0x8a2a1072b587fff, 1),
/// ];
/// let r = libh3::k_ring_distances(0x8a2a1072b59ffff, 1);
/// assert_eq!(r, expected_kring_distances);
/// ```
Get all hexagons in a k-ring around a given center, in an array of arrays
ordered by distance from the origin. The order of the hexagons within each ring is undefined.
Get all hexagons in a k - ring around a given center in an array of arrays ordered by distance from the origin . The order of the hexagons within each ring is undefined .
pub fn k_ring_distances(origin: H3Index, radius: i32) -> Vec<(H3Index, i32)> {
    unsafe {
        let max = libh3_sys::maxKringSize(radius);
        let mut indexes = Vec::<H3Index>::with_capacity(max as usize);
        let mut distances = Vec::<i32>::with_capacity(max as usize);
        libh3_sys::kRingDistances(origin, radius, indexes.as_mut_ptr(), distances.as_mut_ptr());
        indexes.set_len(max as usize);
        distances.set_len(max as usize);
        indexes
            .into_iter()
            .zip(distances.into_iter())
            .filter(|v| v.0 != 0)
            .collect::<Vec<(H3Index, i32)>>()
    }
}
pub fn k_ring_distances ( origin : H3Index , radius : i32 ) -> Vec < ( H3Index , i32 ) > { unsafe { let max = libh3_sys :: maxKringSize ( radius ) ; let mut indexes = Vec :: < H3Index > :: with_capacity ( max as usize ) ; let mut distances = Vec :: < i32 > :: with_capacity ( max as usize ) ; libh3_sys :: kRingDistances ( origin , radius , indexes . as_mut_ptr ( ) , distances . as_mut_ptr ( ) ) ; indexes . set_len ( max as usize ) ; distances . set_len ( max as usize ) ; indexes . into_iter ( ) . zip ( distances . into_iter ( ) ) . filter ( | v | v . 0 != 0 ) . collect :: < Vec < ( H3Index , i32 ) > > ( ) } }
Get all hexagons in a k-ring around a given center, in an array of arrays
ordered by distance from the origin.
Get all hexagons in a k - ring around a given center in an array of arrays ordered by distance from the origin .
origin
H3Index
radius
i32
origin
H3Index
radius
i32