hexRing method

  1. @override
List<BigInt> hexRing(
  1. BigInt h3Index,
  2. int ringSize
)
override

Hollow hexagon ring at some origin

Implementation

@override
List<BigInt> hexRing(BigInt h3Index, int ringSize) {
  return using((arena) {
    final kIndex = ringSize == 0 ? 1 : 6 * ringSize;
    final out = arena<Uint64>(kIndex);
    final resultCode = _h3c.hexRing(h3Index.toInt(), ringSize, out);
    if (resultCode != 0) {
      throw H3Exception('Failed to get hexRing (encountered a pentagon?)');
    }
    final list = out.asTypedList(kIndex).toList();
    return list.where((e) => e != 0).map((e) => e.toBigInt()).toList();
  });
}