Open liujun3660105 opened 4 months ago
for example:
const regionBox = {
xmin: -180,
ymin: -90,
xmax: 0,
ymax: 0
};
const polygon = [
[regionBox.ymin, regionBox.xmin],
[regionBox.ymax, regionBox.xmin],
[regionBox.ymax, regionBox.xmax],
[regionBox.ymin, regionBox.xmax]
];
const hexagons = h3.polygonToCells(polygon, 2);
This is currently the expected behavior, and should be better documented - the polygonToCells
function will reject polygons with arcs > 180 degrees on longitude, because we do not currently enforce winding order so the area enclosed by the polygon is ambiguous (it could stretch across the antimeridian).
The workaround is to break very large polygons into smaller polygons with < 180 degrees of longitude.
when the polygon is very large,and the res is more than 0,then has error as follow: