h3SetToFeatureCollection method
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,
};
}