h3ToParent method

  1. @override
BigInt h3ToParent(
  1. BigInt h3Index,
  2. int resolution
)
override

Get the parent of the given h3Index hexagon at a particular resolution

Returns 0 when result can't be calculated

Implementation

@override
BigInt h3ToParent(BigInt h3Index, int resolution) {
  // ignore: unnecessary_cast
  final res = h3_js.h3ToParent(h3Index.toH3JS(), resolution) as String?;
  if (res == null) {
    return BigInt.zero;
  }
  return res.toBigInt();
}