Turf 6.5.0
turf.cleanCoords(turf.lineString([[0, 0], [0, 1], [0, 0]])) causes an invalid polygon error to occur though interestingly turf.lineString([[0, 0], [0, 1], [0, 0]]) is just fine.
Expecting the output to be {"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[0,0],[0,1]]}} as there is no point in a lineString which goes to a location and returns on exactly the same path?
Another example that can trigger the invalid polygon error: turf.cleanCoords(turf.lineString([[0, 0], [0, 0], [0, 2], [0,2], [0, 0]]))
Turf 6.5.0
turf.cleanCoords(turf.lineString([[0, 0], [0, 1], [0, 0]]))causes an invalid polygon error to occur though interestinglyturf.lineString([[0, 0], [0, 1], [0, 0]])is just fine.Expecting the output to be
{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[0,0],[0,1]]}}as there is no point in a lineString which goes to a location and returns on exactly the same path?Another example that can trigger the invalid polygon error:
turf.cleanCoords(turf.lineString([[0, 0], [0, 0], [0, 2], [0,2], [0, 0]]))