Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infinite loop observed in union #153

Open
oli-clive-griffin opened this issue May 19, 2023 · 1 comment
Open

infinite loop observed in union #153

oli-clive-griffin opened this issue May 19, 2023 · 1 comment

Comments

@oli-clive-griffin
Copy link

oli-clive-griffin commented May 19, 2023

infinite loop observed in union, fixed by using turf.truncate to 10 decimal points

import * as polygonClipping from 'polygon-clipping'

polygonClipping.union(
  [[[171.38681097322578,-44.05193393982489],[171.38696010571954,-44.05192230384896],[171.38692411,-44.051925112],[171.38687354,-44.051929058],[171.386873539,-44.051929058],[171.386810979,-44.051933939],[171.38681097322578,-44.05193393982489]]],
  [[[171.38216241325586,-44.05229664100789],[171.382162575,-44.052296646],[171.382162609,-44.05229665],[171.382162702,-44.052296673],[171.38216274,-44.052296688],[171.38216284,-44.052296745],[171.382162865,-44.052296763],[171.382162926,-44.052296827],[171.382332591,-44.052523859],[171.382332734,-44.052524012],[171.382332784,-44.052524051],[171.382332947,-44.052524152],[171.383910442,-44.053318615],[171.383910648,-44.053318698],[171.383910778,-44.053318734],[171.38391090555854,-44.0533187542934],[171.38394223150206,-44.05332192762649],[171.383953006,-44.053323019],[171.38397539895917,-44.053325287505785],[171.386707,-44.053602],[171.386828,-44.053614],[171.3879117968861,-44.053129252878854],[171.387920746,-44.053050828],[171.388008464,-44.052998274],[171.390039,-44.051238],[171.388758,-44.050846],[171.386964,-44.051922],[171.38681097322572,-44.05193393982489],[171.386810972,-44.05193394],[171.38680424886283,-44.05193446448939],[171.38674840134456,-44.05193882195946],[171.3866858384556,-44.05194370339242],[171.386685834,-44.051943704],[171.38666341334513,-44.0519454530986],[171.38651022206582,-44.0519574057589],[171.386510208,-44.051957407],[171.38647705179042,-44.05195999385031],[171.38645645743117,-44.05196160071319],[171.386447666,-44.051962287],[171.38644765614328,-44.05196228742855],[171.38635765914478,-44.05196930939192],[171.386338392,-44.051970813],[171.386322525,-44.051972051],[171.38632252132288,-44.051972051],[171.38515875427024,-44.05206285324617],[171.384022477,-44.052151511],[171.382633808,-44.052259861],[171.382571254,-44.052264742],[171.382571235,-44.052264743],[171.382513232,-44.052269269],[171.382508677,-44.052269624],[171.38249293290755,-44.05227085240466],[171.38216241325586,-44.05229664100789]]],
)
@oli-clive-griffin oli-clive-griffin changed the title infinite loop infinite loop observed in union May 19, 2023
@oli-clive-griffin
Copy link
Author

Screen.Recording.2023-05-19.at.10.23.24.AM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant