Skip to content

Commit

Permalink
bug on cellsToLinkedMultiPolygon for children of pentagon
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfriend committed Sep 26, 2024
1 parent 9cc20fd commit 7a37a85
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/apps/testapps/testCellsToLinkedMultiPolygon.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ SUITE(cellsToLinkedMultiPolygon) {
H3_EXPORT(destroyLinkedMultiPolygon)(&polygon);
}

TEST(pentagonChldren) {
// children of pentagon 0x80ebfffffffffff
H3Index kids[] = {0x81ea3ffffffffff, 0x81eabffffffffff,
0x81eafffffffffff, 0x81eb3ffffffffff,
0x81eb7ffffffffff, 0x81ebbffffffffff};
int numCells = ARRAY_SIZE(set);

LinkedGeoPolygon polygon;
t_assertSuccess(
H3_EXPORT(cellsToLinkedMultiPolygon)(kids, numCells, &polygon));

// Since these are the children of a cell, we exepect a single loop with
// no holes.
t_assert(countLinkedLoops(&polygon) == 2, "1 loop added to polygon");

H3_EXPORT(destroyLinkedMultiPolygon)(&polygon);
}

// TODO: This test asserts incorrect behavior - we should be creating
// multiple polygons, each with their own single loop. Update when the
// algorithm is corrected.
Expand Down

0 comments on commit 7a37a85

Please sign in to comment.