Skip to content

Cleancoords on edge case lineString results in 'invalid polygon' error #2305

@plarner30

Description

@plarner30

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]]))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions