const polygon = {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: [[
[-180.00, -90.00],
[-180.00, 90.00],
[ 180.00, 90.00],
[ 180.00, -90.00],
[-180.00, -90.00]
]]
}
};
const hexagons = geojson2h3.featureToH3Set(polygon, 0);
console.log(hexagons.length);
// output → 0, expected 122
// change coords to
coordinates: [[
[-179.00, -89.00],
[-179.00, 89.00],
[ 179.00, 89.00],
[ 179.00, -89.00],
[-179.00, -89.00]
]]
// output → 1, expected 122
console.log(geojson2h3.featureToH3Set(polygon, 2).length);
// ouput → 31, expected 5882
what am I doing wrong?