You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]]))
The text was updated successfully, but these errors were encountered:
Hi. I am facing the same issue. The code of cleanCoords has been fixed in august 2021, but [email protected] has been generated in july 2021. Is there a plan to generate a new version of turf that would include this fixed code?
@benoitbzl in case you weren't aware 7.1.0 of turf has been released. From your comment above the "invalid polygon" error sounds like it will have been fixed in that release.
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?
Not quite true @plarner30. A lineString that goes both directions is twice as long for starters, so can't really be considered the same.
Once the PR to close #2740 is merged will close this as well, as all the test cases listed should then work consistently.
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]]))
The text was updated successfully, but these errors were encountered: