Open naoak opened 1 year ago
This is an interesting case. cleanCoords effectively refuses to clean a redundant point if it's the start or end point of a polygon.
Taking example A above as polygon a-b-c-d-e-f-a and running cleanCoords:
Giving us a-b-d-e-f-a. Technically though, that polygon is really only defined by b-d-e-f-b, so a is still a redundant point.
On paper I would say this is a bug in cleanCoords. There shouldn't be any protected status offered to the start or end point of a polygon.
Both of these polygons have the same shape and are in the same location. The length of the coordinates is also the same. The only difference is the order of the coordinates.
A:
B:
cleanCoords() drops [3,1] from A, whereas it does [1,3] and [3,1] from B. Therefore, the lengths of the coordinates are different and the result of booleanEqual is false. In polygon A, [1,3] is at the starting point, so it seems to make that difference.