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
When using turf.intersect with specific polygon and multipolygon inputs, the function enters an infinite loop. This issue occurs with Turf.js version 7.1.0 and appears to be related to the polygon-clipping.cjs.js library used within Turf.js.
Steps to Reproduce
The issue can be observed with the following code:
You can see a demonstration of the issue and further details via this JSFiddle.
The function enters an infinite loop. Debugging suggests that the issue arises in the polygon-clipping.cjs.js library, specifically in the operation.run, within sweepLine.process.
The following code snippet from polygon-clipping.cjs.js seems to be where the problem originates:
Thanks for reporting this @fheldtm and tracking down where the problem is occurring. This is a known issue with the polygon-clipping library. We have an item our backlog to replace that library entirely, though can't provide an ETA.
Another way forward would be for polygon-clipping to fix this bug. Have you tried raising this issue with them?
Version Information
Description
When using
turf.intersect
with specific polygon and multipolygon inputs, the function enters an infinite loop. This issue occurs with Turf.js version 7.1.0 and appears to be related to thepolygon-clipping.cjs.js
library used within Turf.js.Steps to Reproduce
The issue can be observed with the following code:
You can see a demonstration of the issue and further details via this JSFiddle.
The function enters an infinite loop. Debugging suggests that the issue arises in the
polygon-clipping.cjs.js
library, specifically in theoperation.run
, withinsweepLine.process
.The following code snippet from
polygon-clipping.cjs.js
seems to be where the problem originates:In this code,
prevSeg
becomes undefined, causing an infinite loop.The text was updated successfully, but these errors were encountered: