h3SetToFeatureCollection method

Map<String, dynamic> h3SetToFeatureCollection(
  1. List<BigInt> hexagons, {
  2. Map? properties(
    1. BigInt h3Index
    )?,
})

Convert a list of hexagons to a GeoJSON FeatureCollection with each hexagon in a separate Polygon feature with optional properties.

Implementation

Map<String, dynamic> h3SetToFeatureCollection(List<BigInt> hexagons,
    {Map? Function(BigInt h3Index)? properties}) {
  final features = hexagons
      .map(
        (e) => h3ToFeature(e, properties: properties?.call(e)),
      )
      .toList();
  return {
    'type': _featureCollection,
    'features': features,
  };
}