Geojson2H3
The geojson2h3
library provides a set of utilities for converting between GeoJSON polygons and H3 hexagon indexes, designed to be used alongside with h3_dart or h3_flutter.
It's a Dart port of the JavaScript library geojson2h3.
// h3_flutter example
import 'package:h3_flutter/h3_flutter.dart';
final h3Factory = const H3Factory();
final h3 = h3Factory.load();
final geojson2h3 = Geojson2H3(h3);
final hexagon = H3Index.from(0x89283082837ffff);
final hexagonFeature = geojson2h3.h3ToFeature(hexagon);
Currently, the library is in an early stage and supports only two methods:
geojson2h3.h3ToFeature()
geojson2h3.h3SetToFeatureCollection()
You can find more information about these methods in the original geojson2h3 documentation.